Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Commit 081db39

Browse files
authored
Merge pull request #238 from subspace/sdk-ci-fix
Fix CI to be in parity with monorepo
2 parents be159f7 + 608d2c5 commit 081db39

File tree

1 file changed

+40
-14
lines changed

1 file changed

+40
-14
lines changed

.github/workflows/push.yml

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Rust checks and tests
22
on:
33
pull_request:
44
paths-ignore:
5-
- '**.md'
6-
- '.gitignore'
5+
- "**.md"
6+
- ".gitignore"
77

88
workflow_dispatch:
99
inputs:
@@ -68,43 +68,59 @@ jobs:
6868
with:
6969
repo-token: ${{ secrets.GITHUB_TOKEN }}
7070

71+
# Needed for hwloc
72+
- name: Install automake (macOS)
73+
run: brew install automake
74+
if: runner.os == 'macOS'
75+
7176
# Workaround to resolve link error with C:\msys64\mingw64\bin\libclang.dll
7277
- name: Remove msys64
7378
run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
7479
if: runner.os == 'Windows'
7580
continue-on-error: true
7681

77-
- name: Add cache
78-
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
82+
- name: Configure cache
83+
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # @v3.3.2
7984
with:
8085
path: |
8186
~/.cargo/registry
8287
~/.cargo/bin
88+
~/.cargo/git
8389
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}
90+
restore-keys: |
91+
${{ runner.os }}-${{ runner.arch }}-cargo-
8492
8593
- name: Clean unused crate source checkouts and git repo checkouts
8694
run: cargo cache
8795

88-
- uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d # v1.0.7
96+
- name: cargo clippy (Linux & Windows)
97+
uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d # v1.0.7
8998
with:
9099
token: ${{ secrets.GITHUB_TOKEN }}
91-
args: --locked -- -D warnings
100+
args: --locked --all-targets -- -D warnings
101+
if: runner.os != 'macOS'
102+
103+
- name: cargo clippy (MacOS)
104+
uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d # @v1.0.7
105+
with:
106+
token: ${{ secrets.GITHUB_TOKEN }}
107+
args: --locked --no-default-features -- -D warnings
108+
if: runner.os == 'macOS'
92109

93110
- name: Clean unused artifacts
94111
run: cargo sweep --maxsize ${{ env.MAX_TARGET_SIZE }}
95112

96-
97113
test:
98114
strategy:
99115
matrix:
100116
os: ${{ fromJson(github.repository_owner == 'subspace' && '[["self-hosted", "ubuntu-20.04-x86-64"], ["self-hosted", "macos-12-arm64"], ["self-hosted", "windows-server-2022-x86-64"]]' || '["ubuntu-20.04", "macos-12", "windows-2022"]') }}
101117
run-all:
102118
- ${{ inputs.test-macos-and-windows || github.ref == 'refs/heads/master' }}
103-
exclude: # exclude macos-12 and window-2022 when the condition is false
104-
- run-all: false
105-
os: macos-12
106-
- run-all: false
107-
os: windows-2022
119+
exclude: # exclude macos-12 and window-2022 when the condition is false
120+
- run-all: false
121+
os: macos-12
122+
- run-all: false
123+
os: windows-2022
108124

109125
runs-on: ${{ matrix.os }}
110126

@@ -124,14 +140,19 @@ jobs:
124140
with:
125141
repo-token: ${{ secrets.GITHUB_TOKEN }}
126142

143+
# Needed for hwloc
144+
- name: Install automake (macOS)
145+
run: brew install automake
146+
if: runner.os == 'macOS'
147+
127148
# Workaround to resolve link error with C:\msys64\mingw64\bin\libclang.dll
128149
- name: Remove msys64
129150
run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
130151
if: runner.os == 'Windows'
131152
continue-on-error: true
132153

133154
- name: Add cache
134-
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
155+
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # @v3.3.2
135156
if: runner.os != 'Windows'
136157
with:
137158
path: |
@@ -152,8 +173,13 @@ jobs:
152173
if: runner.os != 'Windows'
153174
run: cargo cache
154175

155-
- name: Build and run tests
176+
- name: Build and run tests (linux & windows)
156177
run: cargo test --locked --test integration --release --features=integration-test -- --test-threads=1 --nocapture
178+
if: runner.os != 'macOS'
179+
180+
- name: Build and run tests (macOS)
181+
run: cargo test --locked --test integration --release --no-default-features --features=integration-test -- --test-threads=1 --nocapture
182+
if: runner.os == 'macOS'
157183

158184
- name: Clean unused artifacts
159185
if: runner.os != 'Windows'

0 commit comments

Comments
 (0)