Skip to content

Commit b7041df

Browse files
committed
Use setup-bazel action in GitHub Actions
1 parent c927e05 commit b7041df

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

.github/workflows/main.yml

+10-14
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,16 @@ jobs:
8181
with:
8282
distribution: 'zulu'
8383
java-version: ${{ matrix.java }}
84-
- name: Mount bazel cache
85-
uses: actions/cache@v1
84+
- name: Setup Bazel
85+
uses: bazel-contrib/[email protected]
8686
with:
87-
path: "/home/runner/.cache/bazel"
88-
key: bazel
89-
- name: Install bazel
90-
run: |
91-
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64"
92-
mkdir -p "${GITHUB_WORKSPACE}/bin/"
93-
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
94-
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
87+
# Avoid downloading Bazel every time.
88+
bazelisk-cache: true
89+
# Store build cache per workflow.
90+
disk-cache: ${{ github.workflow }}
91+
# Share repository cache between workflows.
92+
repository-cache: true
9593
- name: Test
96-
run: |
97-
"${GITHUB_WORKSPACE}/bin/bazel" test //...
94+
run: bazelisk test //...
9895
- name: Build
99-
run: |
100-
"${GITHUB_WORKSPACE}/bin/bazel" build //...
96+
run: bazelisk build //...

mapstruct-on-bazel/.bazelversion

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.1.0

0 commit comments

Comments
 (0)