Skip to content

Commit 2a5716d

Browse files
wip: try dependency flow
1 parent 49afbb4 commit 2a5716d

4 files changed

Lines changed: 132 additions & 81 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -13,93 +13,26 @@ env:
1313
RUSTFLAGS: -Dwarnings
1414

1515
jobs:
16-
lint-each-os:
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
os: [ubuntu-24.04, macos-14, windows-2022]
21-
feature-args: ['', '-Funstable-mobile-app']
22-
include:
23-
- feature-args: ''
24-
feature-suffix: ''
25-
- feature-args: '-Funstable-mobile-app'
26-
feature-suffix: ', mobile-app'
27-
28-
name: Lint (${{ matrix.os }}${{ matrix.feature-suffix }})
29-
runs-on: ${{ matrix.os }}
30-
steps:
31-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
32-
33-
- name: Install Rust Toolchain
34-
run: rustup toolchain install stable --profile minimal --component clippy --component rustfmt --no-self-update
35-
36-
- uses: swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # 2.8.0
37-
38-
- name: Run Rustfmt
39-
run: cargo fmt --all -- --check
40-
41-
- name: Run Clippy
42-
run: cargo clippy --workspace --tests ${{ matrix.feature-args }}
43-
4416
lint:
45-
needs: lint-each-os
46-
runs-on: ubuntu-24.04
47-
if: always() # Run even if lint-each-os fails
4817
name: Lint
49-
steps:
50-
- name: Check for lint failures
51-
if: contains(needs.lint-each-os.result, 'failure') || contains(needs.lint-each-os.result, 'skipped')
52-
run: |
53-
echo "Required lint check failed. You need to fix the problem before merging."
54-
exit 1
18+
uses: ./.github/workflows/lint.yml
5519

5620
test:
57-
strategy:
58-
fail-fast: false
59-
matrix:
60-
os: [ubuntu-24.04, macos-14, windows-2022]
61-
feature-args: ['', '-Funstable-mobile-app']
62-
include:
63-
- feature-args: ''
64-
feature-suffix: ''
65-
- feature-args: '-Funstable-mobile-app'
66-
feature-suffix: ', mobile-app'
67-
68-
name: Test (${{ matrix.os }}${{ matrix.feature-suffix }})
69-
runs-on: ${{ matrix.os }}
70-
71-
steps:
72-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
73-
74-
- uses: swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # 2.8.0
75-
with:
76-
key: ${{ github.job }}
77-
78-
- name: Run Cargo Tests
79-
run: cargo test --all ${{ matrix.feature-args }}
21+
name: Test
22+
uses: ./.github/workflows/test.yml
8023

8124
test_node:
82-
strategy:
83-
fail-fast: false
84-
matrix:
85-
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x]
25+
name: Test Node
26+
uses: ./.github/workflows/test_node.yml
8627

87-
name: Test Node ${{ matrix.node-version }}
28+
required:
29+
name: Check required jobs
8830
runs-on: ubuntu-24.04
89-
31+
needs: [lint, test, test_node]
32+
if: always()
9033
steps:
91-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
92-
93-
- name: Use Node.js ${{ matrix.node-version }}
94-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
95-
with:
96-
node-version: ${{ matrix.node-version }}
97-
98-
# We need to skip the fallback download because downloading will fail on release branches because the new version isn't available yet.
99-
- run: SENTRYCLI_SKIP_DOWNLOAD=1 npm install
100-
101-
# older node versions need an older nft
102-
- run: SENTRYCLI_SKIP_DOWNLOAD=1 npm install @vercel/nft@0.22.1
103-
if: matrix.node-version == '10.x' || matrix.node-version == '12.x'
104-
105-
- run: npm test
34+
- name: Check for failure
35+
if: ${{ needs.lint.result != 'success' || needs.test.result != 'success' || needs.test_node.result != 'success' }}
36+
run: |
37+
echo "One or more jobs failed"
38+
exit 1

.github/workflows/lint.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Lint
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
matrix-result:
7+
description: 'Matrix job result'
8+
value: ${{ jobs.lint.result }}
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
lint:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-24.04, macos-14, windows-2022]
20+
feature-args: ['', '-Funstable-mobile-app']
21+
include:
22+
- feature-args: ''
23+
feature-suffix: ''
24+
- feature-args: '-Funstable-mobile-app'
25+
feature-suffix: ', mobile-app'
26+
27+
name: ${{ matrix.os }}${{ matrix.feature-suffix }}
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
31+
32+
- name: Install Rust Toolchain
33+
run: rustup toolchain install stable --profile minimal --component clippy --component rustfmt --no-self-update
34+
35+
- uses: swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # 2.8.0
36+
37+
- name: Run Rustfmt
38+
run: cargo fmt --all -- --check
39+
40+
- name: Run Clippy
41+
run: cargo clippy --workspace --tests ${{ matrix.feature-args }}

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Test
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
matrix-result:
7+
description: 'Matrix job result'
8+
value: ${{ jobs.test.result }}
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-24.04, macos-14, windows-2022]
20+
feature-args: ['', '-Funstable-mobile-app']
21+
include:
22+
- feature-args: ''
23+
feature-suffix: ''
24+
- feature-args: '-Funstable-mobile-app'
25+
feature-suffix: ', mobile-app'
26+
27+
name: Test (${{ matrix.os }}${{ matrix.feature-suffix }})
28+
runs-on: ${{ matrix.os }}
29+
30+
steps:
31+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
32+
33+
- uses: swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # 2.8.0
34+
with:
35+
key: ${{ github.job }}
36+
37+
- name: Run Cargo Tests
38+
run: cargo test --all ${{ matrix.feature-args }}

.github/workflows/test_node.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test Node
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
matrix-result:
7+
description: 'Matrix job result'
8+
value: ${{ jobs.test_node.result }}
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test_node:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x]
20+
21+
name: Test Node ${{ matrix.node-version }}
22+
runs-on: ubuntu-24.04
23+
24+
steps:
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
26+
27+
- name: Use Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
32+
# We need to skip the fallback download because downloading will fail on release branches because the new version isn't available yet.
33+
- run: SENTRYCLI_SKIP_DOWNLOAD=1 npm install
34+
35+
# older node versions need an older nft
36+
- run: SENTRYCLI_SKIP_DOWNLOAD=1 npm install @vercel/nft@0.22.1
37+
if: matrix.node-version == '10.x' || matrix.node-version == '12.x'
38+
39+
- run: npm test

0 commit comments

Comments
 (0)