|
1 | | -name: "Run Tests" |
| 1 | +name: 'Run Tests' |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | pull_request: |
5 | 5 | push: |
6 | | - branches: [ master ] |
| 6 | + branches: [master] |
7 | 7 |
|
8 | 8 | permissions: |
9 | | - actions: write |
| 9 | + actions: read |
10 | 10 | contents: write |
11 | 11 | pull-requests: write |
12 | 12 |
|
13 | 13 | jobs: |
14 | 14 | tests: |
15 | 15 | env: |
16 | | - SCCACHE_GHA_ENABLED: "true" |
17 | | - RUSTC_WRAPPER: "sccache" |
18 | | - CARGO_INCREMENTAL: "0" |
| 16 | + SCCACHE_GHA_ENABLED: 'true' |
| 17 | + RUSTC_WRAPPER: 'sccache' |
| 18 | + CARGO_INCREMENTAL: '0' |
19 | 19 | strategy: |
20 | 20 | matrix: |
21 | | - os: [ ubuntu-latest-16 ] |
| 21 | + os: [ubuntu-latest-16] |
22 | 22 | runs-on: ${{ matrix.os }} |
23 | 23 |
|
24 | 24 | steps: |
25 | | - - uses: actions/checkout@v4 |
26 | | - - uses: cachix/install-nix-action@v26 |
27 | | - - uses: cachix/cachix-action@v14 |
28 | | - with: |
29 | | - name: devenv |
30 | | - - name: sccache |
31 | | - uses: Mozilla-Actions/sccache-action@main |
32 | | - - uses: Swatinem/rust-cache@v2 |
| 25 | + - name: Checkout repo |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Setup devenv |
| 29 | + uses: andyl-technologies/andyl-github-action/setup-devenv@master |
| 30 | + |
| 31 | + - name: Setup Rust cache |
| 32 | + uses: andyl-technologies/andyl-github-action/rust-cache@master |
33 | 33 | with: |
34 | 34 | cache-all-crates: true |
35 | | - save-if: ${{ github.ref == 'refs/heads/master' }} |
36 | | - |
37 | | - - name: Install devenv.sh |
38 | | - run: nix profile install nixpkgs#devenv |
| 35 | + use-ccache: true |
39 | 36 |
|
40 | 37 | - name: Run tests |
41 | 38 | run: devenv test |
42 | 39 |
|
43 | 40 | coverage: |
44 | 41 | strategy: |
45 | 42 | matrix: |
46 | | - os: [ ubuntu-latest ] |
| 43 | + os: [ubuntu-latest] |
47 | 44 | runs-on: ${{ matrix.os }} |
48 | 45 | steps: |
49 | | - - uses: actions/checkout@v4 |
50 | | - - uses: cachix/install-nix-action@v26 |
51 | | - - uses: cachix/cachix-action@v14 |
52 | | - with: |
53 | | - name: devenv |
54 | | - - name: Install devenv.sh |
55 | | - run: nix profile install nixpkgs#devenv |
56 | | - - uses: Swatinem/rust-cache@v2 |
57 | | - - uses: taiki-e/install-action@cargo-llvm-cov |
58 | | - - name: Run coverage |
| 46 | + - name: Checkout repo |
| 47 | + uses: actions/checkout@v4 |
| 48 | + |
| 49 | + - name: Setup devenv |
| 50 | + uses: andyl-technologies/andyl-github-action/setup-devenv@master |
| 51 | + |
| 52 | + - name: Setup Rust cache |
| 53 | + uses: andyl-technologies/andyl-github-action/rust-cache@master |
| 54 | + |
| 55 | + - name: Run coverage tests |
59 | 56 | run: devenv shell wasm-trampoline-coverage |
60 | | - - name: Generate Coverage Report |
| 57 | + |
| 58 | + - name: Generate coverage report |
61 | 59 | uses: clearlyip/code-coverage-report-action@v5 |
62 | 60 | id: code_coverage_report_action |
63 | 61 | if: ${{ github.actor != 'dependabot[bot]'}} |
64 | 62 | with: |
65 | 63 | filename: 'coverage.cobertura.xml' |
66 | 64 | artifact_download_workflow_names: '"Run Tests",cron' |
67 | | - - name: Add Coverage PR Comment |
| 65 | + |
| 66 | + - name: Add coverage PR comment |
68 | 67 | uses: marocchino/sticky-pull-request-comment@v2 |
69 | | - if: steps.code_coverage_report_action.outputs.file != '' && github.event_name == 'pull_request' && (success() || failure()) |
| 68 | + if: |
| 69 | + steps.code_coverage_report_action.outputs.file != '' && |
| 70 | + github.event_name == 'pull_request' && (success() || failure()) |
70 | 71 | with: |
71 | 72 | recreate: true |
72 | 73 | path: code-coverage-results.md |
0 commit comments