|
2 | 2 | # SPDX-FileContributor: Adam Poulemanos <adam@knit.li> |
3 | 3 | # |
4 | 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 |
5 | | - |
6 | 5 | name: CI |
7 | | - |
8 | 6 | on: |
9 | | - push: |
10 | | - branches: [main, develop] |
11 | | - pull_request: |
12 | | - branches: [main, develop] |
13 | | - |
| 7 | + push: |
| 8 | + branches: [main, develop] |
| 9 | + pull_request: |
| 10 | + branches: [main, develop] |
14 | 11 | env: |
15 | | - CARGO_TERM_COLOR: always |
16 | | - |
| 12 | + CARGO_TERM_COLOR: always |
17 | 13 | jobs: |
18 | | - test: |
19 | | - name: Test Suite |
20 | | - runs-on: ubuntu-latest |
21 | | - strategy: |
22 | | - matrix: |
23 | | - rust: |
24 | | - - stable |
25 | | - - beta |
26 | | - - nightly |
27 | | - steps: |
28 | | - - uses: actions/checkout@v4 |
29 | | - with: |
30 | | - submodules: recursive |
31 | | - |
32 | | - - name: Install Rust |
33 | | - uses: dtolnay/rust-toolchain@master |
34 | | - with: |
35 | | - toolchain: ${{ matrix.rust }} |
36 | | - components: rustfmt, clippy |
37 | | - |
38 | | - - name: Cache cargo registry |
39 | | - uses: actions/cache@v4 |
40 | | - with: |
41 | | - path: ~/.cargo/registry |
42 | | - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} |
43 | | - |
44 | | - - name: Cache cargo index |
45 | | - uses: actions/cache@v4 |
46 | | - with: |
47 | | - path: ~/.cargo/git |
48 | | - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} |
49 | | - |
50 | | - - name: Cache cargo build |
51 | | - uses: actions/cache@v4 |
52 | | - with: |
53 | | - path: target |
54 | | - key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} |
55 | | - |
56 | | - - name: Set up mise |
57 | | - run: | |
58 | | - chmod -R +x ./scripts |
59 | | - ./install-mise.sh |
60 | | - MISE="$HOME/.local/bin/mise" |
61 | | - echo 'eval "$($MISE activate bash)"' >> "$HOME/.bashrc" |
62 | | - source "$HOME/.bashrc" |
63 | | - $MISE run install |
64 | | - - name: Run hk ci workflow |
65 | | - run: $HOME/.local/bin/mise run ci |
66 | | - |
67 | | - security_audit: |
68 | | - name: Security Audit |
69 | | - runs-on: ubuntu-latest |
70 | | - steps: |
71 | | - - uses: actions/checkout@v4 |
72 | | - - uses: rustsec/audit-check@v1.4.1 |
73 | | - with: |
74 | | - token: ${{ secrets.GITHUB_TOKEN }} |
75 | | - |
76 | | - coverage: |
77 | | - name: Code Coverage |
78 | | - runs-on: ubuntu-latest |
79 | | - steps: |
80 | | - - uses: actions/checkout@v4 |
81 | | - with: |
82 | | - submodules: recursive |
83 | | - |
84 | | - - name: Install Rust |
85 | | - uses: dtolnay/rust-toolchain@stable |
86 | | - with: |
87 | | - components: llvm-tools-preview |
88 | | - |
89 | | - - name: Install cargo-llvm-cov |
90 | | - uses: taiki-e/install-action@cargo-llvm-cov |
91 | | - |
92 | | - - name: Generate code coverage |
93 | | - run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info |
94 | | - |
95 | | - - name: Upload coverage to Codecov |
96 | | - uses: codecov/codecov-action@v4 |
97 | | - with: |
98 | | - files: lcov.info |
99 | | - fail_ci_if_error: true |
| 14 | + test: |
| 15 | + name: Test Suite |
| 16 | + runs-on: ubuntu-latest |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + rust: |
| 20 | + - stable |
| 21 | + - beta |
| 22 | + - nightly |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + submodules: recursive |
| 27 | + - name: Install Rust |
| 28 | + uses: dtolnay/rust-toolchain@master |
| 29 | + with: |
| 30 | + toolchain: ${{ matrix.rust }} |
| 31 | + components: rustfmt, clippy |
| 32 | + - name: Cache cargo registry |
| 33 | + uses: actions/cache@v4 |
| 34 | + with: |
| 35 | + path: ~/.cargo/registry |
| 36 | + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} |
| 37 | + - name: Cache cargo index |
| 38 | + uses: actions/cache@v4 |
| 39 | + with: |
| 40 | + path: ~/.cargo/git |
| 41 | + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} |
| 42 | + - name: Cache cargo build |
| 43 | + uses: actions/cache@v4 |
| 44 | + with: |
| 45 | + path: target |
| 46 | + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} |
| 47 | + - name: Set up mise |
| 48 | + run: | |
| 49 | + chmod -R +x ./scripts |
| 50 | + ./install-mise.sh |
| 51 | + MISE="$HOME/.local/bin/mise" |
| 52 | + echo \"eval "$($MISE activate bash)"\" >> "$HOME/.bashrc" |
| 53 | + source "$HOME/.bashrc" |
| 54 | + $MISE run install |
| 55 | + - name: Run hk ci workflow |
| 56 | + run: > |
| 57 | + "$HOME/.local/bin/mise" run ci |
| 58 | + security_audit: |
| 59 | + name: Security Audit |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v4 |
| 63 | + - uses: rustsec/audit-check@v1.4.1 |
| 64 | + with: |
| 65 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 66 | + coverage: |
| 67 | + name: Code Coverage |
| 68 | + runs-on: ubuntu-latest |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + with: |
| 72 | + submodules: recursive |
| 73 | + - name: Install Rust |
| 74 | + uses: dtolnay/rust-toolchain@stable |
| 75 | + with: |
| 76 | + components: llvm-tools-preview |
| 77 | + - name: Install cargo-llvm-cov |
| 78 | + uses: taiki-e/install-action@cargo-llvm-cov |
| 79 | + - name: Generate code coverage |
| 80 | + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info |
| 81 | + - name: Upload coverage to Codecov |
| 82 | + uses: codecov/codecov-action@v4 |
| 83 | + with: |
| 84 | + files: lcov.info |
| 85 | + fail_ci_if_error: true |
0 commit comments