Skip to content

Commit 8ed1588

Browse files
committed
DO NOT MERGE. Debug "sudo" in GHA
1 parent ec08bdc commit 8ed1588

File tree

3 files changed

+278
-356
lines changed

3 files changed

+278
-356
lines changed

.cirrus.yml

-82
Original file line numberDiff line numberDiff line change
@@ -1,83 +1 @@
1-
cargo_cache:
2-
folder: $CARGO_HOME/registry
3-
fingerprint_script: cat Cargo.lock || echo ""
41

5-
env:
6-
# Build by default; don't just check
7-
BUILD: build
8-
CLIPPYFLAGS: -D warnings -A unknown-lints
9-
RUSTFLAGS: -D warnings
10-
RUSTDOCFLAGS: -D warnings
11-
TOOL: cargo
12-
MSRV: 1.69.0
13-
ZFLAGS:
14-
15-
# Tests that don't require executing the build binaries
16-
build: &BUILD
17-
build_script:
18-
- . $HOME/.cargo/env || true
19-
- $TOOL -Vv
20-
- rustc -Vv
21-
- $TOOL $BUILD $ZFLAGS --target $TARGET --all-targets --all-features
22-
- $TOOL doc $ZFLAGS --no-deps --target $TARGET --all-features
23-
- $TOOL clippy $ZFLAGS --target $TARGET --all-targets --all-features -- $CLIPPYFLAGS
24-
- if [ -z "$NOHACK" ]; then mkdir -p $HOME/.cargo/bin; export PATH=$HOME/.cargo/bin:$PATH; fi
25-
- if [ -z "$NOHACK" ]; then curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-${HOST:-$TARGET}.tar.gz | tar xzf - -C ~/.cargo/bin; fi
26-
- if [ -z "$NOHACK" ]; then $TOOL hack $ZFLAGS check --target $TARGET --each-feature; fi
27-
28-
# Tests that do require executing the binaries
29-
test: &TEST
30-
<< : *BUILD
31-
test_script:
32-
- . $HOME/.cargo/env || true
33-
- $TOOL test --target $TARGET --all-features
34-
35-
# Test FreeBSD in a full VM. Test the i686 target too, in the
36-
# same VM. The binary will be built in 32-bit mode, but will execute on a
37-
# 64-bit kernel and in a 64-bit environment. Our tests don't execute any of
38-
# the system's binaries, so the environment shouldn't matter.
39-
task:
40-
env:
41-
TARGET: x86_64-unknown-freebsd
42-
matrix:
43-
- name: FreeBSD 14 amd64 & i686
44-
freebsd_instance:
45-
image_family: freebsd-14-0-snap
46-
cpu: 1
47-
# Enable tests that would fail on FreeBSD 12
48-
RUSTFLAGS: --cfg fbsd14 -D warnings
49-
RUSTDOCFLAGS: --cfg fbsd14
50-
setup_script:
51-
- kldload mqueuefs
52-
- fetch https://sh.rustup.rs -o rustup.sh
53-
- sh rustup.sh -y --profile=minimal --default-toolchain $MSRV
54-
- . $HOME/.cargo/env
55-
- rustup target add i686-unknown-freebsd
56-
- rustup component add clippy
57-
<< : *TEST
58-
i386_test_script:
59-
- . $HOME/.cargo/env
60-
- cargo build --target i686-unknown-freebsd --all-features
61-
- cargo doc --no-deps --target i686-unknown-freebsd --all-features
62-
- cargo test --target i686-unknown-freebsd --all-features
63-
i386_feature_script:
64-
- . $HOME/.cargo/env
65-
- if [ -z "$NOHACK" ]; then cargo hack check --each-feature --target i686-unknown-freebsd; fi
66-
before_cache_script: rm -rf $CARGO_HOME/registry/index
67-
68-
# Tasks for Linux aarch64 native builds
69-
task:
70-
matrix:
71-
- name: Linux aarch64
72-
arm_container:
73-
image: rust:1.69.0
74-
cpu: 1
75-
depends_on:
76-
- FreeBSD 14 amd64 & i686
77-
env:
78-
TARGET: aarch64-unknown-linux-gnu
79-
setup_script:
80-
- rustup target add $TARGET
81-
- rustup component add clippy
82-
<< : *TEST
83-
before_cache_script: rm -rf $CARGO_HOME/registry/index

.github/actions/test/action.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@ runs:
2424
2525
- name: test
2626
shell: bash
27-
run: sudo -E ${{ inputs.TOOL }} test --target ${{ inputs.TARGET }} --all-features
27+
run: |
28+
which cargo
29+
echo $PATH
30+
echo 'echo $PATH' | sudo --preserve-env=PATH sh
31+
sudo --preserve-env=PATH ${{ inputs.TOOL }} test --target ${{ inputs.TARGET }} --all-features

0 commit comments

Comments
 (0)