-
Notifications
You must be signed in to change notification settings - Fork 259
75 lines (66 loc) · 2.38 KB
/
code-coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Code coverage
on:
# Currently disabled due to cargo-tarpaulin timing out on the GH Ubuntu hosts.
# Ref: https://github.com/fermyon/spin/issues/1350
# Will need to investigate and tune usage/invocation to get passing before re-enabling.
# schedule:
# - cron: '0 0 * * *'
workflow_dispatch:
jobs:
build-rust:
name: Build Spin
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'fermyon' }} || ${{ github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v3
- name: setup dependencies
uses: ./.github/actions/spin-ci-dependencies
with:
rust: true
rust-wasm: true
rust-cache: true
- name: Cargo Build
run: cargo build --workspace --all-targets --features all-tests --features openssl/vendored
- name: "Archive executable artifact"
uses: actions/upload-artifact@v4
with:
name: spin-ubuntu-latest
path: target/debug/spin
code-coverage:
name: Run code coverage
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'fermyon' }} || ${{ github.event_name == 'workflow_dispatch' }}
needs: build-rust
steps:
- uses: actions/checkout@v3
- name: setup dependencies
uses: ./.github/actions/spin-ci-dependencies
with:
rust: true
rust-wasm: true
nomad: true
- name: Install cargo-tarpaulin binary crate
uses: actions-rs/[email protected]
with:
crate: cargo-tarpaulin
version: 0.19.1
use-tool-cache: true
- name: Cargo Tarpaulin
run: cargo tarpaulin --follow-exec --skip-clean -t 6000 --out xml --features openssl/vendored,default
env:
RUST_LOG: spin=trace
# Only attempt to upload to codecov.io if the repo owner is fermyon.
# This allows forks to run code coverage manually, without needing
# to have a codecov token for uploading.
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'fermyon' }}
with:
fail_ci_if_error: true
verbose: true
- name: Archive code coverage results
uses: actions/upload-artifact@v4
if: ${{ github.ref == 'refs/heads/main' }}
with:
name: code-coverage-report
path: cobertura.xml