forked from OptimatistOpenSource/perf-event-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (97 loc) · 3.59 KB
/
build-dev.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
115
name: Build / Development
on:
push:
branches:
- '*'
pull_request_target:
types:
- edited
- opened
- reopened
- synchronize
jobs:
build-dev:
name: ${{ matrix.target.alias }}-${{ matrix.linux-headers.alias }}
runs-on: ${{ matrix.target.os }}
strategy:
fail-fast: false
matrix:
target:
- { os: ubuntu-20.04, triple: x86_64-unknown-linux-gnu , alias: amd64-gnu-ubuntu-20.04 }
# - { os: ubuntu-20.04, triple: x86_64-unknown-linux-musl, alias: amd64-musl-ubuntu-20.04 }
# - { os: ubuntu-22.04, triple: x86_64-unknown-linux-gnu , alias: amd64-gnu-ubuntu-22.04 }
# - { os: ubuntu-22.04, triple: x86_64-unknown-linux-musl, alias: amd64-musl-ubuntu-22.04 }
linux-headers:
- { pkg: linux-headers-5.15.0-91-generic, install-path: /usr/src/linux-headers-5.15.0-90-generic, alias: 5.15 }
# - { pkg: linux-headers-5.19.0-50-generic, install-path: /usr/src/linux-headers-5.19.0-50-generic, alias: 5.19 }
# - { pkg: linux-headers-6.2.0-39-generic , install-path: /usr/src/linux-headers-6.2.0-39-generic , alias: 6.2 }
# - { pkg: linux-headers-6.5.0-14-generic , install-path: /usr/src/linux-headers-6.5.0-14-generic , alias: 6.5 }
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
toolchain: 1.75.0
components: rustfmt, clippy
- name: Show environment information
shell: bash
run: |
cargo -V
cargo clippy -V
cargo fmt -- -V
rustc -V
uname -a
- name: Show apt information
shell: bash
run: apt search linux-headers-5.19.0-50 | grep generic
- name: Setup musl-tools
if: matrix.target.triple == 'x86_64-unknown-linux-musl'
shell: bash
run: sudo apt -y install musl-tools
- name: Install linux headers
shell: bash
run: sudo apt install -y ${{ matrix.linux-headers.pkg }}
- name: Setup LINUX_HEADERS_PATH
shell: bash
run: export LINUX_HEADERS_PATH="${{ matrix.linux-headers.install-path }}"
- name: Add target
uses: ./.github/actions/add-target
with:
target: ${{ matrix.target.triple }}
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.target.alias }}
- name: Generate version
id: gen-version
shell: bash
run: echo 'VERSION=0.0.0-${{ github.sha }}' >> $GITHUB_OUTPUT
- name: Replace version
uses: ./.github/actions/replace-version
with:
version: ${{ steps.gen-version.outputs.VERSION }}
- name: Select feature
id: select-feature
shell: bash
run: echo "FEATURE=linux-$(./select-feature.sh ${{ matrix.linux-headers.alias }})" >> $GITHUB_OUTPUT
- name: Run build
uses: ./.github/actions/build
with:
target: ${{ matrix.target.triple }}
feature: ${{ steps.select-feature.outputs.FEATURE }}
release: false
- name: Run check
uses: ./.github/actions/check
with:
target: ${{ matrix.target.triple }}
feature: ${{ steps.select-feature.outputs.FEATURE }}
- name: Run test
uses: ./.github/actions/test
with:
target: ${{ matrix.target.triple }}
feature: ${{ steps.select-feature.outputs.FEATURE }}