|
17 | 17 | on: [push, pull_request] |
18 | 18 |
|
19 | 19 | jobs: |
20 | | - code_format: |
21 | | - name: Style/format |
22 | | - runs-on: ${{ matrix.job.os }} |
23 | | - strategy: |
24 | | - fail-fast: false |
25 | | - matrix: |
26 | | - job: |
27 | | - - { os: ubuntu-latest , features: feat_os_unix } |
28 | | - steps: |
29 | | - - uses: actions/checkout@v2 |
30 | | - - name: Initialize workflow variables |
31 | | - id: vars |
32 | | - shell: bash |
33 | | - run: | |
34 | | - ## VARs setup |
35 | | - outputs() { for var in "$@" ; do echo steps.vars.outputs.${var}="${!var}"; echo ::set-output name=${var}::${!var}; done; } |
36 | | - # target-specific options |
37 | | - # * CARGO_FEATURES_OPTION |
38 | | - CARGO_FEATURES_OPTION='' ; |
39 | | - if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features "${{ matrix.job.features }}"' ; fi |
40 | | - outputs CARGO_FEATURES_OPTION |
41 | | - - name: Install `rust` toolchain |
42 | | - uses: actions-rs/toolchain@v1 |
43 | | - with: |
44 | | - toolchain: stable |
45 | | - default: true |
46 | | - profile: minimal # minimal component installation (ie, no documentation) |
47 | | - components: rustfmt |
48 | | - - name: "`fmt` testing" |
49 | | - shell: bash |
50 | | - run: | |
51 | | - # `fmt` testing |
52 | | - # * convert any warnings to GHA UI annotations; ref: <https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message> |
53 | | - S=$(cargo fmt -- --check) && printf "%s\n" "$S" || { printf "%s\n" "$S" | sed -E -n -e "s/^Diff[[:space:]]+in[[:space:]]+${PWD//\//\\/}\/(.*)[[:space:]]+at[[:space:]]+[^0-9]+([0-9]+).*$/::warning file=\1,line=\2::WARNING: \`cargo fmt\`: style violation/p" ; } |
54 | | - - name: "`fmt` testing of tests" |
55 | | - shell: bash |
56 | | - run: | |
57 | | - # `fmt` testing of tests |
58 | | - # * convert any warnings to GHA UI annotations; ref: <https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message> |
59 | | - S=$(find tests -name "*.rs" -print0 | xargs -0 cargo fmt -- --check) && printf "%s\n" "$S" || { printf "%s\n" "$S" | sed -E -n "s/^Diff[[:space:]]+in[[:space:]]+${PWD//\//\\/}\/(.*)[[:space:]]+at[[:space:]]+[^0-9]+([0-9]+).*$/::warning file=\1,line=\2::WARNING: \`cargo fmt\`: style violation/p" ; } |
60 | 20 |
|
61 | 21 | code_spellcheck: |
62 | 22 | name: Style/spelling |
@@ -114,64 +74,6 @@ jobs: |
114 | 74 | # * convert any warnings to GHA UI annotations; ref: <https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message> |
115 | 75 | S=$(cargo +nightly clippy --all-targets ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -- -D warnings 2>&1) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n -e '/^error:/{' -e "N; s/^error:[[:space:]]+(.*)\\n[[:space:]]+-->[[:space:]]+(.*):([0-9]+):([0-9]+).*$/::warning file=\2,line=\3,col=\4::WARNING: \`cargo clippy\`: \1/p;" -e '}' ; } |
116 | 76 |
|
117 | | - min_version: |
118 | | - name: MinRustV # Minimum supported rust version |
119 | | - runs-on: ${{ matrix.job.os }} |
120 | | - strategy: |
121 | | - matrix: |
122 | | - job: |
123 | | - - { os: ubuntu-latest , features: feat_os_unix } |
124 | | - steps: |
125 | | - - uses: actions/checkout@v2 |
126 | | - - name: Install `rust` toolchain (v${{ env.RUST_MIN_SRV }}) |
127 | | - uses: actions-rs/toolchain@v1 |
128 | | - with: |
129 | | - toolchain: ${{ env.RUST_MIN_SRV }} |
130 | | - default: true |
131 | | - profile: minimal # minimal component installation (ie, no documentation) |
132 | | - - name: Install `cargo-tree` # for dependency information |
133 | | - uses: actions-rs/install@v0.1 |
134 | | - with: |
135 | | - crate: cargo-tree |
136 | | - version: latest |
137 | | - use-tool-cache: true |
138 | | - env: |
139 | | - RUSTUP_TOOLCHAIN: stable |
140 | | - - name: Confirm compatible 'Cargo.lock' |
141 | | - shell: bash |
142 | | - run: | |
143 | | - # Confirm compatible 'Cargo.lock' |
144 | | - # * 'Cargo.lock' is required to be in a format that `cargo` of MinSRV can interpret (eg, v1-format for MinSRV < v1.38) |
145 | | - cargo fetch --locked --quiet || { echo "::error file=Cargo.lock::Incompatible 'Cargo.lock' format; try \`cargo +${{ env.RUST_MIN_SRV }} update\`" ; exit 1 ; } |
146 | | - - name: Info |
147 | | - shell: bash |
148 | | - run: | |
149 | | - # Info |
150 | | - ## environment |
151 | | - echo "## environment" |
152 | | - echo "CI='${CI}'" |
153 | | - ## tooling info display |
154 | | - echo "## tooling" |
155 | | - which gcc >/dev/null 2>&1 && (gcc --version | head -1) || true |
156 | | - rustup -V |
157 | | - rustup show active-toolchain |
158 | | - cargo -V |
159 | | - rustc -V |
160 | | - cargo-tree tree -V |
161 | | - ## dependencies |
162 | | - echo "## dependency list" |
163 | | - cargo fetch --locked --quiet |
164 | | - ## * using the 'stable' toolchain is necessary to avoid "unexpected '--filter-platform'" errors |
165 | | - RUSTUP_TOOLCHAIN=stable cargo-tree tree --frozen --all --no-dev-dependencies --no-indent --features ${{ matrix.job.features }} | grep -vE "$PWD" | sort --unique |
166 | | -
|
167 | | - - name: Test |
168 | | - uses: actions-rs/cargo@v1 |
169 | | - with: |
170 | | - command: test |
171 | | - args: --features "feat_os_unix" -p uucore -p coreutils |
172 | | - env: |
173 | | - RUSTFLAGS: '-Awarnings' |
174 | | - |
175 | 77 | busybox_test: |
176 | 78 | name: Busybox test suite |
177 | 79 | runs-on: ${{ matrix.job.os }} |
|
0 commit comments