Bump the github-actions group with 2 updates #1969
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| name: 'Build' | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Cancel any previous runs for the same branch that are still running. | |
| - name: 'Cancel previous runs' | |
| uses: styfle/cancel-workflow-action@d07a454dad7609a92316b57b23c9ccfd4f59af66 # 0.13.1 | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: 'Check out repository' | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: 'Set up JDK 26 for compilation' | |
| uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 | |
| with: | |
| java-version: 26 | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| - name: 'Install' | |
| shell: bash | |
| run: mvn -B -P!standard-with-extra-repos install -U -DskipTests=true | |
| - name: 'Javadoc Test Run' | |
| shell: bash | |
| run: mvn -B -P!standard-with-extra-repos javadoc:aggregate -U | |
| - name: 'Upload build artifacts' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: truth-jars | |
| path: | | |
| **/target/*.jar | |
| !**/target/*-sources.jar | |
| !**/target/*-javadoc.jar | |
| test: | |
| name: "Test with JDK ${{ matrix.java }}" | |
| needs: build | |
| strategy: | |
| matrix: | |
| java: [ 8, 17, 25 ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 'Check out repository' | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: 'Set up JDK ${{ matrix.java }} for testing' | |
| uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 | |
| with: | |
| java-version: ${{ matrix.java }} | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| - name: 'Download build artifacts' | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: truth-jars | |
| - name: 'Unpack artifacts' | |
| shell: bash | |
| run: | | |
| for f in $(find . -name "*.jar" ! -name "*-gwt.jar"); do | |
| dest="${f%/target/*}/target/classes" | |
| mkdir -p "$dest" | |
| unzip -o "$f" -d "$dest" | |
| done | |
| - name: 'Test' | |
| shell: bash | |
| run: mvn -B -P!standard-with-extra-repos verify -U -Dmaven.javadoc.skip=true -Dmaven.main.skip=true | |
| publish_snapshot: | |
| name: 'Publish snapshot' | |
| needs: [build, test] | |
| if: github.event_name == 'push' && github.repository == 'google/truth' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 'Check out repository' | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: 'Set up JDK 26' | |
| uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 | |
| with: | |
| java-version: 26 | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| server-id: central | |
| server-username: CI_DEPLOY_USERNAME | |
| server-password: CI_DEPLOY_PASSWORD | |
| - name: 'Publish' | |
| env: | |
| CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} | |
| CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} | |
| run: mvn -B clean deploy -DskipTests=true | |
| generate_docs: | |
| permissions: | |
| contents: write | |
| name: 'Generate latest docs' | |
| needs: [build, test] | |
| if: github.event_name == 'push' && github.repository == 'google/truth' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 'Check out repository' | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: 'Set up JDK 26' | |
| uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 | |
| with: | |
| java-version: 26 | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| - name: 'Generate latest docs' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: ./util/generate-latest-docs.sh |