Fix job changed-files (#1732)

* Fix job `changed-files`

Convert `ALL_CHANGED_FILES` to multiple lines before processing

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

* Run e2e-tests and unit-tests on aarch64-apple-darwin

Since the CI now uses M1 instead of x86_64, built a native executable
instead of relying on rosetta

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

* Run unit-tests on Linux-only

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

---------

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2024-06-12 20:56:59 +10:00 committed by GitHub
parent 6622bf1ae3
commit 7941387b73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 19 deletions

View file

@ -56,7 +56,6 @@ jobs:
dir_names: true
dir_names_exclude_current_dir: true
dir_names_max_depth: 2
separator: "\n"
- name: List all changed files
id: list-changed-files
@ -64,27 +63,16 @@ jobs:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
set -euxo pipefail
crates_changed="$(echo "$ALL_CHANGED_FILES" | grep crates | cut -d / -f 2 || echo)"
crates_changed="$(for file in $ALL_CHANGED_FILES; do echo $file; done | grep crates | cut -d / -f 2 || echo)"
has_detect_target_changed="$(echo "$crates_changed" | grep -q detect-targets && echo true || echo false)"
echo "crates_changed=${crates_changed//$'\n'/ }" | tee -a "$GITHUB_OUTPUT"
echo "has_detect_target_changed=$has_detect_target_changed" | tee -a "$GITHUB_OUTPUT"
unit-tests:
needs: changed-files
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 }}
runs-on: ubuntu-latest
env:
CARGO_BUILD_TARGET: ${{ matrix.target }}
CARGO_BUILD_TARGET: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
@ -118,7 +106,7 @@ jobs:
fail-fast: false
matrix:
include:
- target: x86_64-apple-darwin
- target: aarch64-apple-darwin
os: macos-14
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
@ -158,7 +146,7 @@ jobs:
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-apple-darwin
- target: x86_64-apple-darwin
os: macos-14
- target: aarch64-pc-windows-msvc
os: windows-latest

View file

@ -27,9 +27,9 @@ jobs:
fail-fast: false
matrix:
include:
- { o: macos-14, t: x86_64-apple-darwin, r: true }
- { o: macos-14, t: x86_64-apple-darwin }
- { o: macos-14, t: x86_64h-apple-darwin }
- { o: macos-14, t: aarch64-apple-darwin }
- { o: macos-14, t: aarch64-apple-darwin, r: true }
- {
o: ubuntu-latest,
t: x86_64-unknown-linux-gnu,