diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f59725c9..1d01065d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,7 @@ jobs: echo "crates_changed=$crates_changed" | tee -a "$GITHUB_OUTPUT" echo "has_detect_target_changed=$has_detect_target_changed" | tee -a "$GITHUB_OUTPUT" - test: + unit-tests: needs: changed-files strategy: fail-fast: false @@ -107,11 +107,41 @@ jobs: done echo "CARGO_NEXTEST_ADDITIONAL_ARGS=$ARGS" | tee -a "$GITHUB_ENV" - - run: just test + - run: just unit-tests env: GITHUB_TOKEN: ${{ secrets.CI_TEST_GITHUB_TOKEN }} CI_UNIT_TEST_GITHUB_TOKEN: ${{ secrets.CI_UNIT_TEST_GITHUB_TOKEN }} + e2e-tests: + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-apple-darwin + os: macos-14 + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + - target: x86_64-pc-windows-msvc + os: windows-latest + + runs-on: ${{ matrix.os }} + env: + CARGO_BUILD_TARGET: ${{ matrix.target }} + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/just-setup + env: + # just-setup use binstall to install sccache, + # which works better when we provide it with GITHUB_TOKEN. + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} + + - run: | + just build + just e2e-tests + env: + GITHUB_TOKEN: ${{ secrets.CI_TEST_GITHUB_TOKEN }} + cross-check: strategy: fail-fast: false @@ -357,7 +387,8 @@ jobs: tests-pass: name: Tests pass needs: - - test + - unit-tests + - e2e-tests - cross-check - lint - release-dry-run diff --git a/justfile b/justfile index c6d74dfe..01270a4f 100644 --- a/justfile +++ b/justfile @@ -262,7 +262,7 @@ e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repo unit-tests: print-env cargo nextest run --target {{target}} {{cargo-nextest-additional-args}} - cargo test --doc {{cargo-build-args}} + cargo test --doc --target {{target}} test: unit-tests build e2e-tests