chore: Use Nix in CI where possible #5154
Workflow file for this run
This file contains 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
# Workflow for testing Spoon. | |
# | |
# Note that actions are specified by commit hash. This is to avoid the security | |
# risk of someone injecting malicious code into a release and then simply | |
# changing a tag. | |
name: tests | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
- chore/flakey-flakey-rise-and-shine | |
schedule: | |
- cron: "0 0 * * *" | |
env: | |
MAVEN_OPTS: >- | |
-Dmaven.resolver.transport=native | |
-Daether.connector.connectTimeout=300000 | |
-Daether.connector.requestTimeout=300000 | |
jobs: | |
test-linux: | |
runs-on: ${{ matrix.os }} | |
name: Tests with Java ${{ matrix.java }} on ${{ matrix.os }} | |
strategy: | |
matrix: | |
java: [11, 17, 20] | |
os: [ubuntu-latest] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup env | |
uses: ./.github/actions/setup-tests | |
- name: Time nix setup | |
run: nix develop .#jdk${{ matrix.java }} --command true | |
- name: Test | |
run: nix develop .#jdk${{ matrix.java }} --command test | |
test-windows: | |
runs-on: windows-latest | |
name: Tests with Java 17 on windows-latest | |
steps: | |
- name: Disable Git's autocrlf | |
run: git config --global core.autocrlf false | |
- name: git checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
- name: Test | |
run: | | |
cp chore/logback.xml src/test/resources/ | |
mvn -f spoon-pom test | |
cat testResults.spoon | |
coverage: | |
runs-on: ubuntu-latest | |
name: Test with coverage | |
steps: | |
- name: Checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup env | |
uses: ./.github/actions/setup-tests | |
- name: Time nix setup | |
run: nix develop --command true | |
- name: Run tests with coverage | |
run: nix develop --command coverage | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PR_NUMBER: ${{ github.event.number }} | |
extra: | |
runs-on: ubuntu-latest | |
name: Extra checks | |
steps: | |
- name: Checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup env | |
uses: ./.github/actions/setup-tests | |
- name: Time nix setup | |
run: nix develop .#extraChecks --command true | |
- name: Run extra checks | |
run: nix develop .#extraChecks --command extra | |
- name: Trigger extra remote tasks | |
if: github.repository == 'INRIA/spoon' && github.event_name == 'pull_request' | |
run: nix develop .#extraChecks --command extra-remote | |
- name: Run Javadoc quality check | |
run: nix develop .#extraChecks --command javadoc-quality | |
reproducible-builds: | |
runs-on: ubuntu-latest | |
name: reproducible-builds | |
steps: | |
- name: Checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup env | |
uses: ./.github/actions/setup-tests | |
- name: Time nix setup | |
run: nix develop --command true | |
- name: Check status | |
run: nix develop --command reproducible-builds | |
maven-central-requirements: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup env | |
uses: ./.github/actions/setup-tests | |
- name: Time nix setup | |
run: nix develop --command true | |
- name: Check maven pom quality | |
run: nix develop --command maven-pom-quality |