Skip to content

Commit 948db4f

Browse files
committed
Split ubuntu build from the matrix in ci.yml
This is in order to launch the 'run-test-lab' step as soon as possible since the mac os build are really slow without cache & there seems to be not a lot of mac os runner available on github side (meaning that we often wait for one to be available).
1 parent 147f911 commit 948db4f

File tree

2 files changed

+72
-43
lines changed

2 files changed

+72
-43
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: build-upload-mithril-artifact
2+
description: Build the Mithril workspace & publish the artifacts using 'actions/upload-artifact'
3+
inputs:
4+
build-args:
5+
description: Arguments to pass to 'cargo build'
6+
required: false
7+
default: ''
8+
cache-version:
9+
description: Version of the current cache
10+
required: false
11+
default: ''
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Install stable toolchain
16+
uses: actions-rs/toolchain@v1
17+
with:
18+
profile: minimal
19+
toolchain: stable
20+
override: true
21+
22+
- name: Rust Cache
23+
uses: Swatinem/rust-cache@v2
24+
with:
25+
key: ${{ runner.os }}-cache-v${{ inputs.cache-version }}
26+
27+
- name: Cargo build
28+
uses: actions-rs/cargo@v1
29+
with:
30+
command: build
31+
args: --release ${{ inputs.build-args }}
32+
33+
- name: Publish Mithril Distribution (${{ runner.os }}-${{ runner.arch }})
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: mithril-distribution-${{ runner.os }}-${{ runner.arch }}
37+
path: |
38+
target/release/libmithril.*
39+
target/release/libmithril_common.*
40+
target/release/mithril-aggregator
41+
target/release/mithril-aggregator.exe
42+
target/release/mithril-client
43+
target/release/mithril-client.exe
44+
target/release/mithril-signer
45+
target/release/mithril-signer.exe
46+
target/release/mithrildemo
47+
target/release/mithrildemo.exe
48+
if-no-files-found: error

.github/workflows/ci.yml

Lines changed: 24 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,29 @@ on:
99
- 'mithril-explorer/**'
1010

1111
jobs:
12+
build-ubuntu-X64:
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- name: Checkout sources
16+
uses: actions/checkout@v3
17+
18+
- name: Build Mithril workspace & publish artifacts
19+
uses: ./.github/workflows/actions/build-upload-mithril-artifact
20+
with:
21+
cache-version: ${{ secrets.CACHE_VERSION }}
22+
23+
- name: Publish End-to-end runner (${{ runner.os }}-${{ runner.arch }})
24+
uses: actions/upload-artifact@v3
25+
with:
26+
name: mithril-end-to-end-${{ runner.os }}-${{ runner.arch }}
27+
path: target/release/mithril-end-to-end
28+
if-no-files-found: error
29+
1230
build:
1331
strategy:
1432
fail-fast: false
1533
matrix:
16-
os: [ ubuntu-22.04, macos-12, windows-latest ]
34+
os: [ macos-12, windows-latest ]
1735

1836
include:
1937
# Only build client on windows & mac
@@ -26,49 +44,12 @@ jobs:
2644
steps:
2745
- name: Checkout sources
2846
uses: actions/checkout@v3
29-
30-
- name: Install stable toolchain
31-
uses: actions-rs/toolchain@v1
32-
with:
33-
profile: minimal
34-
toolchain: stable
35-
override: true
36-
37-
- name: Rust Cache
38-
uses: Swatinem/rust-cache@v2
39-
with:
40-
key: ${{ runner.os }}-cache-v${{ secrets.CACHE_VERSION }}
4147

42-
- name: Cargo build
43-
uses: actions-rs/cargo@v1
44-
with:
45-
command: build
46-
args: --release ${{ matrix.build-args }}
47-
48-
- name: Publish Mithril Distribution (${{ runner.os }}-${{ runner.arch }})
49-
uses: actions/upload-artifact@v3
48+
- name: Build Mithril workspace & publish artifacts
49+
uses: ./.github/workflows/actions/build-upload-mithril-artifact
5050
with:
51-
name: mithril-distribution-${{ runner.os }}-${{ runner.arch }}
52-
path: |
53-
target/release/libmithril.*
54-
target/release/libmithril_common.*
55-
target/release/mithril-aggregator
56-
target/release/mithril-aggregator.exe
57-
target/release/mithril-client
58-
target/release/mithril-client.exe
59-
target/release/mithril-signer
60-
target/release/mithril-signer.exe
61-
target/release/mithrildemo
62-
target/release/mithrildemo.exe
63-
if-no-files-found: error
64-
65-
- name: Publish End-to-end runner (${{ runner.os }}-${{ runner.arch }})
66-
uses: actions/upload-artifact@v3
67-
if: ${{ runner.os == 'Linux' }}
68-
with:
69-
name: mithril-end-to-end-${{ runner.os }}-${{ runner.arch }}
70-
path: target/release/mithril-end-to-end
71-
if-no-files-found: error
51+
cache-version: ${{ secrets.CACHE_VERSION }}
52+
build-args: ${{ matrix.build-args }}
7253

7354
test:
7455
strategy:
@@ -184,7 +165,7 @@ jobs:
184165

185166
run-test-lab:
186167
runs-on: ubuntu-22.04
187-
needs: [ build ]
168+
needs: [ build-ubuntu-X64 ]
188169
steps:
189170
- name: Checkout sources
190171
uses: actions/checkout@v3

0 commit comments

Comments
 (0)