Skip to content

Commit 3745fe7

Browse files
authored
CICD: Introduce check-only for Redox CI (#10950)
1 parent 5d03f63 commit 3745fe7

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

.github/workflows/CICD.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -630,11 +630,11 @@ jobs:
630630
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: "feat_os_unix,test_risky_names", use-cross: use-cross, skip-publish: true }
631631
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: "feat_os_unix,uudoc" , use-cross: no, workspace-tests: true }
632632
- { os: ubuntu-latest , target: x86_64-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross }
633-
- { os: ubuntu-latest , target: x86_64-unknown-redox , features: feat_os_unix_redox , use-cross: redoxer , skip-tests: true }
633+
- { os: ubuntu-latest , target: x86_64-unknown-redox , features: feat_os_unix_redox , use-cross: redoxer , skip-tests: true , check-only: true }
634634
- { os: ubuntu-latest , target: wasm32-wasip1, default-features: false, features: "basenc,cksum", skip-tests: true }
635635
- { os: macos-latest , target: aarch64-apple-darwin , features: feat_os_macos, workspace-tests: true } # M1 CPU
636-
# PR #7964: Mac should still build even if the feature is not enabled. Do not publish this.
637-
- { os: macos-latest , target: aarch64-apple-darwin , workspace-tests: true, skip-publish: true } # M1 CPU
636+
# PR #7964: chcon should not break build without the feature. cargo check is enough to detect it.
637+
- { os: macos-latest , target: aarch64-apple-darwin , workspace-tests: true, check-only: true } # M1 CPU
638638
- { os: macos-latest , target: x86_64-apple-darwin , features: feat_os_macos, workspace-tests: true }
639639
- { os: windows-latest , target: i686-pc-windows-msvc , features: feat_os_windows }
640640
- { os: windows-latest , target: x86_64-pc-windows-gnu , features: feat_os_windows }
@@ -849,8 +849,16 @@ jobs:
849849
echo "## dependency list"
850850
cargo fetch --locked --quiet --target $(rustc --print host-tuple)
851851
cargo tree --locked --target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} ${{ steps.vars.outputs.CARGO_DEFAULT_FEATURES_OPTION }} --no-dedupe -e=no-dev --prefix=none | grep -vE "$PWD" | sort --unique
852+
- name: Check
853+
shell: bash
854+
if: matrix.job.skip-publish != true && matrix.job.check-only == true
855+
run: |
856+
# expr breaks redox
857+
sed -i.b '/"expr",/d' Cargo.toml
858+
${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} check \
859+
--target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} ${{ steps.vars.outputs.CARGO_DEFAULT_FEATURES_OPTION }}
852860
- name: Test
853-
if: matrix.job.skip-tests != true
861+
if: matrix.job.skip-tests != true && matrix.job.check-only != true
854862
shell: bash
855863
run: |
856864
## Test
@@ -861,13 +869,13 @@ jobs:
861869
RUST_BACKTRACE: "1"
862870
- name: Build
863871
shell: bash
864-
if: matrix.job.skip-publish != true
872+
if: matrix.job.skip-publish != true && matrix.job.check-only != true
865873
run: |
866874
## Build
867875
${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} build --release --config=profile.release.strip=true \
868876
--target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} ${{ steps.vars.outputs.CARGO_DEFAULT_FEATURES_OPTION }}
869877
- name: Package
870-
if: matrix.job.skip-publish != true
878+
if: matrix.job.skip-publish != true && matrix.job.check-only != true
871879
shell: bash
872880
run: |
873881
## Package artifact(s)
@@ -901,7 +909,7 @@ jobs:
901909
tar --zstd -cf docs.tar.zst share
902910
- name: Publish
903911
uses: softprops/action-gh-release@v2
904-
if: steps.vars.outputs.DEPLOY && matrix.job.skip-publish != true
912+
if: steps.vars.outputs.DEPLOY && matrix.job.skip-publish != true && matrix.job.check-only != true
905913
with:
906914
draft: true
907915
files: |
@@ -911,7 +919,7 @@ jobs:
911919
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
912920
- name: Publish latest commit
913921
uses: softprops/action-gh-release@v2
914-
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.job.skip-publish != true
922+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.job.skip-publish != true && matrix.job.check-only != true
915923
with:
916924
tag_name: latest-commit
917925
body: |
@@ -1317,8 +1325,9 @@ jobs:
13171325
run: |
13181326
test -f target/debug/chcon || test -f target/debug/chcon.exe
13191327
test -f target/debug/runcon || test -f target/debug/runcon.exe
1328+
# check is enough to detect workspace breakage by chcon
13201329
- name: Verify workspace builds with stubs
1321-
run: cargo build --features ${{ matrix.job.features }}
1330+
run: cargo check --features ${{ matrix.job.features }}
13221331

13231332
test_safe_traversal:
13241333
name: Safe Traversal Security Check

0 commit comments

Comments
 (0)