-
Notifications
You must be signed in to change notification settings - Fork 351
114 lines (109 loc) · 3.33 KB
/
basic.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: 🔍 Basic Checks
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
changes:
runs-on: ubuntu-22.04
timeout-minutes: 15
outputs:
any_modified: ${{ steps.filter.outputs.any_modified }}
steps:
- uses: actions/checkout@v3
- uses: tj-actions/changed-files@v41
id: filter
with:
files_ignore: |
docs
LICENSE
**.md
- name: List all changed files
run: |
for file in ${{ steps.filter.outputs.all_modified_files }}; do
echo "$file was changed"
done
check:
needs: [changes]
if: needs.changes.outputs.any_modified == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 15
strategy:
matrix:
arch: [ "x86_64", "aarch64" ]
libc: [ "gnu", "musl" ]
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
- name: typos-action
uses: crate-ci/[email protected]
- name: Install just
uses: taiki-e/install-action@just
- name: Install cross-rs
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Setup target
run: |
echo "CARGO=cross" >> ${GITHUB_ENV}
echo "TARGET=${{ matrix.arch }}-unknown-linux-${{ matrix.libc }}" >> ${GITHUB_ENV}
- name: Check formatting and lints
run: just lint
tests:
needs: [changes]
if: needs.changes.outputs.any_modified == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 20
strategy:
matrix:
arch: [ "x86_64" ]
libc: [ "gnu", "musl" ]
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install just
uses: taiki-e/install-action@just
- name: Install cross-rs
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Setup target
run: |
echo "CARGO=cross" >> ${GITHUB_ENV}
echo "TARGET=${{ matrix.arch }}-unknown-linux-${{ matrix.libc }}" >> ${GITHUB_ENV}
- name: Run tests
run: just test-basic
- name: Run feature tests
run: just test-features
coverage:
needs: [changes]
if: needs.changes.outputs.any_modified == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 20
name: Run test coverage
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/[email protected]
- name: Install llvm-tools-preview
run: rustup component add llvm-tools-preview
- name: install cargo-llvm-cov
uses: taiki-e/install-action@v1
with:
tool: [email protected]
- uses: taiki-e/install-action@just
- name: Install requirements
run: sudo env PATH=$PATH just ci-prepare
- name: Run Test Coverage for youki
run: |
cargo llvm-cov clean --workspace
cargo llvm-cov --no-report
cargo llvm-cov --no-run --lcov --output-path ./coverage.lcov
- name: Upload Youki Code Coverage Results
uses: codecov/codecov-action@v3
with:
file: ./coverage.lcov