name: 'Bazel build' description: 'Builds artifacts and creates the Dagger local snapshots.' runs: using: "composite" steps: - name: 'Install Java ${{ env.USE_JAVA_VERSION }}' uses: actions/setup-java@v4 with: distribution: '${{ env.USE_JAVA_DISTRIBUTION }}' java-version: '${{ env.USE_JAVA_VERSION }}' - name: 'Check out repository' uses: actions/checkout@v4 - name: 'Cache Bazel files' uses: actions/cache@v4 with: path: ~/.cache/bazel key: ${{ runner.os }}-bazel-build-${{ github.sha }} restore-keys: | ${{ runner.os }}-bazel-build- - name: 'Java build' run: bazel build //java/... shell: bash - name: 'Install maven version' run: ./util/install-maven.sh ${{ env.USE_MAVEN_VERSION }} shell: bash - name: 'Install local snapshot' run: ./util/install-local-snapshot.sh shell: bash - name: 'Upload local snapshot for tests' uses: actions/upload-artifact@v4 with: name: local-snapshot path: ~/.m2/repository/com/google/dagger - name: 'Clean bazel cache' # According to the documentation, we should be able to exclude these via # the actions/cache path, e.g. "!~/.cache/bazel/*/*/external/" but that # doesn't seem to work. run: | rm -rf $(bazel info repository_cache) rm -rf ~/.cache/bazel/*/*/external/ shell: bash