Skip to content

Commit 6fff02d

Browse files
authored
optimize CI: on pushes to master, only run the docs step, skip others (#447)
1 parent fad30e4 commit 6fff02d

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

.github/scripts/matrices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(
7070
t_linux_x86 = Target("parity-large-new", "x86_64-unknown-linux-gnu", "linux-amd64")
7171
# TODO: Figure out how to make this work
7272
# t_linux_arm = Target("ubuntu-latest", "aarch64-unknown-linux-gnu", "linux-aarch64")
73-
t_macos = Target("parity-macos", "aarch64-apple-darwin", "macosx-aarch64")
73+
t_macos = Target("macos-latest", "aarch64-apple-darwin", "macosx-aarch64")
7474
t_windows = Target("windows-latest", "x86_64-pc-windows-msvc", "windows-amd64")
7575
targets = [t_linux_x86, t_macos, t_windows] if is_pr else [t_linux_x86, t_macos, t_windows]
7676

.github/workflows/nextest.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
type: string
99

1010
concurrency:
11-
group: tests-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
group: tests-${{ github.workflow }}-${{ github.head_ref || github.ref }}
1212
cancel-in-progress: true
1313

1414
env:
@@ -38,7 +38,6 @@ jobs:
3838
PROFILE: ${{ inputs.profile }}
3939
run: |
4040
output=$(python3 .github/scripts/matrices.py)
41-
echo $output
4241
echo "::debug::test-matrix=$output"
4342
echo "test-matrix=$output" >> $GITHUB_OUTPUT
4443
@@ -53,7 +52,7 @@ jobs:
5352
- os: ubuntu
5453
runner: parity-large-new
5554
- os: macos
56-
runner: parity-macos
55+
runner: macos-latest
5756
- os: windows
5857
runner: windows-latest
5958
steps:
@@ -75,10 +74,6 @@ jobs:
7574
path: ~/.cargo/bin/eth-rpc${{ matrix.os == 'windows' && '.exe' || '' }}
7675
key: eth-rpc-${{ matrix.runner }}-${{ env.ETH_RPC_VERSION }}
7776

78-
- name: Set up Homebrew (for mac)
79-
if: matrix.os == 'macos'
80-
uses: Homebrew/actions/setup-homebrew@1ccc07ccd54b6048295516a3eb89b192c35057dc
81-
8277
# Install dependencies for building
8378
- name: Install clang on ubuntu
8479
if: matrix.os == 'ubuntu'
@@ -154,14 +149,6 @@ jobs:
154149
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/${{ secrets.ALCHEMY_API_KEY }}
155150
CARGO_PROFILE_DEV_DEBUG: 0
156151
steps:
157-
- name: Set up Homebrew (for mac)
158-
if: contains(matrix.runner_label, 'macos')
159-
uses: Homebrew/actions/setup-homebrew@1ccc07ccd54b6048295516a3eb89b192c35057dc
160-
- name: Install curl and jq
161-
if: contains(matrix.runner_label, 'macos')
162-
run: |
163-
brew install curl jq
164-
165152
- uses: actions/checkout@v4
166153
- uses: taiki-e/install-action@nextest
167154

.github/workflows/test.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88

99
concurrency:
10-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
1111
cancel-in-progress: true
1212

1313
env:
@@ -16,6 +16,7 @@ env:
1616

1717
jobs:
1818
nextest:
19+
if: github.event_name == 'pull_request'
1920
uses: ./.github/workflows/nextest.yml
2021
with:
2122
profile: default
@@ -53,6 +54,7 @@ jobs:
5354
force_orphan: true
5455

5556
doctest:
57+
if: github.event_name == 'pull_request'
5658
runs-on: parity-large-new
5759
timeout-minutes: 60
5860
steps:
@@ -74,13 +76,15 @@ jobs:
7476
- run: cargo test --workspace --doc
7577

7678
typos:
79+
if: github.event_name == 'pull_request'
7780
runs-on: ubuntu-latest
7881
timeout-minutes: 30
7982
steps:
8083
- uses: actions/checkout@v4
8184
- uses: crate-ci/typos@v1
8285

8386
clippy:
87+
if: github.event_name == 'pull_request'
8488
runs-on: ubuntu-latest
8589
timeout-minutes: 60
8690
steps:
@@ -107,6 +111,7 @@ jobs:
107111
RUSTFLAGS: -Dwarnings
108112

109113
rustfmt:
114+
if: github.event_name == 'pull_request'
110115
runs-on: ubuntu-latest
111116
timeout-minutes: 30
112117
steps:
@@ -117,6 +122,7 @@ jobs:
117122
- run: cargo fmt --all --check
118123

119124
forge-fmt:
125+
if: github.event_name == 'pull_request'
120126
runs-on: ubuntu-latest
121127
timeout-minutes: 30
122128
steps:
@@ -135,6 +141,7 @@ jobs:
135141
run: ./.github/scripts/format.sh --check
136142

137143
crate-checks:
144+
if: github.event_name == 'pull_request'
138145
runs-on: parity-large-new
139146
timeout-minutes: 90
140147
steps:
@@ -167,6 +174,7 @@ jobs:
167174
- run: cargo hack check -p substrate-runtime --each-feature --exclude-no-default-features
168175

169176
deny:
177+
if: github.event_name == 'pull_request'
170178
# Copy of ithacaxyz/ci/.github/workflows/deny.yml@main but without failing the CI
171179
name: cargo deny check
172180
runs-on: ubuntu-latest
@@ -184,8 +192,8 @@ jobs:
184192
run: cargo deny --all-features check all
185193

186194
ci-success:
195+
if: github.event_name == 'pull_request'
187196
runs-on: ubuntu-latest
188-
if: always()
189197
needs:
190198
- nextest
191199
- docs

0 commit comments

Comments
 (0)