Skip to content

Modernize cancellation configuration. #932

Modernize cancellation configuration.

Modernize cancellation configuration. #932

Workflow file for this run

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: continuous-integration
env:
USE_BAZEL_VERSION: '7.1.1'
USE_JAVA_DISTRIBUTION: 'zulu'
USE_JAVA_VERSION: '11'
permissions:
contents: read
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
# For a PR, cancel a job if a new commit is pushed.
# For other pushes to branches, don't cancel jobs.
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#example-using-a-fallback-value
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
maven-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
java: [11, 17, 21]
# Additionally add macos & windows with a single recent JDK
include:
- os: macos-latest
java: 17
# Windows has some line-ending issues right now.
#- os: windows-latest
# java: 17
fail-fast: false
max-parallel: 4
name: Test using Maven with JDK ${{ matrix.java }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: ./.github/actions/maven-test
# Note: We can't fold this into the matrix because it changes the `steps`,
# and `steps` can't reference matrix vars. :-(
bazel-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
java: [11, 17, 21]
# Additionally add macos & windows with a single recent JDK
include:
- os: macos-latest
java: 17
# Windows has some line-ending & "//..."-escaping issues (for build //...) right now.
#- os: windows-latest
# java: 17
fail-fast: false
max-parallel: 4
name: Test using Bazel with JDK ${{ matrix.java }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: ./.github/actions/bazel-test
bazel-build:
runs-on: ubuntu-latest
name: Bazel Build
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: ./.github/actions/bazel-build
local-artifact-tests:
runs-on: ubuntu-latest
needs: [bazel-build]
name: Local Artifact Tests
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: ./.github/actions/local-artifact-tests
publish:
runs-on: ubuntu-latest
needs: [maven-test, bazel-test, bazel-build, local-artifact-tests]
if: github.event_name == 'push' && github.repository == 'google/guice' && github.ref == 'refs/heads/master'
name: Publish Javadoc and Snapshot
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: ./.github/actions/publish-snapshot
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}