Skip to content

Commit a6d9f78

Browse files
authored
Add CI Targets (#22)
* try --tests --lib flag * try args * try default profile * test building examples * add target/toolchain * add libunwind install * wip(action): add build matrix for cli/backends * typo * typo * use args instead of cwd * chore(deps): force Cargo.lock for cli * chore(actions): change matrix order * chore(actions): add CPU targets * chore(actions): add target to job name * chore(actions): add packages to tests * typo * add toolchain input
1 parent cf79afc commit a6d9f78

File tree

7 files changed

+2915
-10
lines changed

7 files changed

+2915
-10
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,25 @@ on: [push, pull_request]
44

55
jobs:
66
build:
7-
name: ${{ matrix.os }}
7+
name: ${{ matrix.package }} - ${{ matrix.os }} - ${{ matrix.target }}
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
os: [macos-latest, ubuntu-latest]
11+
package: [lib, cli, pprofrs, pyspy, rbspy]
12+
os: [ubuntu-latest, macos-latest]
13+
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
14+
exclude:
15+
- os: ubuntu-latest
16+
target: x86_64-apple-darwin
17+
- os: ubuntu-latest
18+
target: aarch64-apple-darwin
19+
- os: macos-latest
20+
target: x86_64-unknown-linux-gnu
21+
- os: macos-latest
22+
target: aarch64-unknown-linux-gnu
1223
steps:
1324
- name: install libunwind (for pprof)
25+
if: matrix.os == 'ubuntu-latest'
1426
continue-on-error: true
1527
run: sudo apt install libunwind8-dev
1628

@@ -24,7 +36,36 @@ jobs:
2436
toolchain: stable
2537
override: true
2638

27-
- name: Run cargo build
39+
- name: Cargo build for pyroscope library
2840
uses: omarabid-forks/rs-cargo@v1
41+
if: matrix.package == 'lib'
2942
with:
3043
command: build
44+
45+
- name: Cargo build for pyrosocpe-cli
46+
uses: omarabid-forks/rs-cargo@v1
47+
if: matrix.package == 'cli'
48+
with:
49+
args: --manifest-path pyroscope_cli/Cargo.toml
50+
command: build
51+
52+
- name: Cargo build for pprof-rs
53+
uses: omarabid-forks/rs-cargo@v1
54+
if: matrix.package == 'pprofrs'
55+
with:
56+
args: --manifest-path pyroscope_backends/pyroscope_pprofrs/Cargo.toml
57+
command: build
58+
59+
- name: Cargo build for pyspy
60+
uses: omarabid-forks/rs-cargo@v1
61+
if: matrix.package == 'pyspy'
62+
with:
63+
args: --manifest-path pyroscope_backends/pyroscope_pyspy/Cargo.toml
64+
command: build
65+
66+
- name: Cargo build for rbspy
67+
uses: omarabid-forks/rs-cargo@v1
68+
if: matrix.package == 'rbspy'
69+
with:
70+
args: --manifest-path pyroscope_backends/pyroscope_rbspy/Cargo.toml
71+
command: build

.github/workflows/tests.yml

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,25 @@ on: [push, pull_request]
44

55
jobs:
66
test:
7-
name: ${{ matrix.os }}
7+
name: ${{ matrix.package }} - ${{ matrix.os }} - ${{ matrix.target }}
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
os: [macos-latest, ubuntu-latest]
11+
package: [lib, cli, pprofrs, pyspy, rbspy]
12+
os: [ubuntu-latest, macos-latest]
13+
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
14+
exclude:
15+
- os: ubuntu-latest
16+
target: x86_64-apple-darwin
17+
- os: ubuntu-latest
18+
target: aarch64-apple-darwin
19+
- os: macos-latest
20+
target: x86_64-unknown-linux-gnu
21+
- os: macos-latest
22+
target: aarch64-unknown-linux-gnu
1223
steps:
1324
- name: install libunwind (for pprof)
25+
if: matrix.os == 'ubuntu-latest'
1426
continue-on-error: true
1527
run: sudo apt install libunwind8-dev
1628

@@ -20,11 +32,42 @@ jobs:
2032
- name: Install stable toolchain
2133
uses: omarabid-forks/rs-toolchain@v1
2234
with:
23-
profile: minimal
35+
profile: default
2436
toolchain: stable
37+
target: ${{ matrix.target }}
2538
override: true
2639

2740
- name: Run cargo test
2841
uses: omarabid-forks/rs-cargo@v1
42+
if: matrix.package == 'lib'
2943
with:
3044
command: test
45+
args: --all
46+
47+
- name: Cargo build for pyrosocpe-cli
48+
uses: omarabid-forks/rs-cargo@v1
49+
if: matrix.package == 'cli'
50+
with:
51+
args: --all --manifest-path pyroscope_cli/Cargo.toml
52+
command: test
53+
54+
- name: Cargo build for pprof-rs
55+
uses: omarabid-forks/rs-cargo@v1
56+
if: matrix.package == 'pprofrs'
57+
with:
58+
args: --all --manifest-path pyroscope_backends/pyroscope_pprofrs/Cargo.toml
59+
command: test
60+
61+
- name: Cargo build for pyspy
62+
uses: omarabid-forks/rs-cargo@v1
63+
if: matrix.package == 'pyspy'
64+
with:
65+
args: --all --manifest-path pyroscope_backends/pyroscope_pyspy/Cargo.toml
66+
command: test
67+
68+
- name: Cargo build for rbspy
69+
uses: omarabid-forks/rs-cargo@v1
70+
if: matrix.package == 'rbspy'
71+
with:
72+
args: --all --manifest-path pyroscope_backends/pyroscope_rbspy/Cargo.toml
73+
command: test

pyroscope_cli/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/target/
2-
Cargo.lock
32
**/*.rs.bk
43
.cache
54
.DS_Store

0 commit comments

Comments
 (0)