Skip to content

Commit 51feb6d

Browse files
committed
ci: verify the new tests and the RISC-V build on the fork
1 parent 1cc70c0 commit 51feb6d

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Fork shimforge coverage
2+
on:
3+
push:
4+
branches: ['shimforge-os-coverage']
5+
workflow_dispatch:
6+
permissions:
7+
contents: read
8+
jobs:
9+
verify:
10+
name: Tests, format, clippy
11+
if: github.repository == 'tanglearncode/riscfetch'
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 20
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
persist-credentials: false
18+
- uses: dtolnay/rust-toolchain@stable
19+
with:
20+
components: rustfmt, clippy
21+
- name: List the new tests
22+
run: cargo test --locked -p riscfetch-core -- --list
23+
- name: Run the new tests 20 times at 8 threads
24+
run: |
25+
for attempt in $(seq 1 20); do
26+
cargo test --locked -p riscfetch-core -- --test-threads=8
27+
done
28+
echo 'riscfetch-core: 20 runs x 8 threads, no fixtures on disk.' >> "$GITHUB_STEP_SUMMARY"
29+
- name: Whole workspace suite
30+
run: cargo test --locked --workspace --verbose
31+
- name: Formatting
32+
run: cargo fmt --check
33+
- name: Clippy
34+
run: cargo clippy -- -D warnings
35+
riscv:
36+
name: Build for RISC-V
37+
if: github.repository == 'tanglearncode/riscfetch'
38+
runs-on: ubuntu-latest
39+
timeout-minutes: 20
40+
steps:
41+
- uses: actions/checkout@v4
42+
with:
43+
persist-credentials: false
44+
- uses: dtolnay/rust-toolchain@stable
45+
with:
46+
targets: riscv64gc-unknown-linux-gnu
47+
- name: Install cross-compilation toolchain
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -y gcc-riscv64-linux-gnu
51+
- name: Configure cargo for cross-compilation
52+
run: |
53+
mkdir -p .cargo
54+
printf '[target.riscv64gc-unknown-linux-gnu]\nlinker = "riscv64-linux-gnu-gcc"\n' >> .cargo/config.toml
55+
- name: Build for RISC-V with the dev-dependency present
56+
run: cargo build --locked --workspace --target riscv64gc-unknown-linux-gnu

0 commit comments

Comments
 (0)