Skip to content

Commit 910b86b

Browse files
authored
[CI] Add action for downloading install artifacts (#814)
1 parent b356023 commit 910b86b

5 files changed

Lines changed: 63 additions & 66 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Download installed package
2+
inputs:
3+
path:
4+
description: Directory to extract into
5+
required: true
6+
name:
7+
description: Artifact name
8+
required: true
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Download artifact
13+
uses: actions/download-artifact@v8
14+
with:
15+
name: ${{ inputs.name }}
16+
- name: Extract archive (unix)
17+
if: runner.os != 'Windows'
18+
shell: bash
19+
run: |
20+
mkdir -p "${{ inputs.path }}"
21+
tar -xzvf "${{ inputs.name }}.tar.gz" -C "${{ inputs.path }}"
22+
- name: Extract archive (windows)
23+
if: runner.os == 'Windows'
24+
shell: pwsh
25+
run: |
26+
$destination = '${{ inputs.path }}'
27+
$parent = Split-Path -Parent $destination
28+
if ([string]::IsNullOrEmpty($parent)) {
29+
$parent = '.'
30+
}
31+
New-Item -ItemType Directory -Force -Path $parent | Out-Null
32+
Expand-Archive `
33+
-Path '${{ inputs.name }}.zip' `
34+
-DestinationPath $parent `
35+
-Force

.github/workflows/mac.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,10 @@ jobs:
7373
brew install ninja mpich llvm libomp openssl
7474
brew link libomp --overwrite --force
7575
- name: Download installed package
76-
uses: actions/download-artifact@v8
76+
uses: ./.github/actions/download-install
7777
with:
78+
path: install
7879
name: macos-clang-install
79-
- name: Extract installed package
80-
run: |
81-
mkdir -p install
82-
tar -xzvf macos-clang-install.tar.gz -C install
8380
- name: Run func tests (MPI)
8481
run: scripts/run_tests.py --running-type="processes" --counts 1 2 3 4
8582
env:
@@ -105,13 +102,10 @@ jobs:
105102
brew install ninja mpich llvm libomp openssl
106103
brew link libomp --overwrite --force
107104
- name: Download installed package
108-
uses: actions/download-artifact@v8
105+
uses: ./.github/actions/download-install
109106
with:
107+
path: install
110108
name: macos-clang-install
111-
- name: Extract installed package
112-
run: |
113-
mkdir -p install
114-
tar -xzvf macos-clang-install.tar.gz -C install
115109
- name: Run tests (threads extended)
116110
run: scripts/run_tests.py --running-type="threads" --counts 5 7 11 13
117111
env:

.github/workflows/perf.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ jobs:
2121
run: |
2222
python3 -m pip install -r requirements.txt --break-system-packages --ignore-installed
2323
- name: Download installed package
24-
uses: actions/download-artifact@v8
24+
uses: ./.github/actions/download-install
2525
with:
26+
path: install
2627
name: ubuntu-gcc-install-ubuntu-24.04
27-
- name: Extract installed package
28-
run: |
29-
mkdir -p install
30-
tar -xzvf ubuntu-gcc-install-ubuntu-24.04.tar.gz -C install
3128
- name: Run perf tests
3229
run: |
3330
scripts/run_tests.py --running-type=performance
@@ -59,13 +56,10 @@ jobs:
5956
brew link libomp --overwrite --force
6057
python3 -m pip install -r requirements.txt --break-system-packages
6158
- name: Download installed package
62-
uses: actions/download-artifact@v8
59+
uses: ./.github/actions/download-install
6360
with:
61+
path: install
6462
name: macos-clang-install
65-
- name: Extract installed package
66-
run: |
67-
mkdir -p install
68-
tar -xzvf macos-clang-install.tar.gz -C install
6963
- name: Run perf tests
7064
run: |
7165
scripts/run_tests.py --running-type=performance

.github/workflows/ubuntu.yml

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,10 @@ jobs:
8282
steps:
8383
- uses: actions/checkout@v6
8484
- name: Download installed package
85-
uses: actions/download-artifact@v8
85+
uses: ./.github/actions/download-install
8686
with:
87+
path: install
8788
name: ubuntu-gcc-install-${{ matrix.os }}
88-
- name: Extract installed package
89-
run: |
90-
mkdir -p install
91-
tar -xzvf ubuntu-gcc-install-${{ matrix.os }}.tar.gz -C install
9289
- name: Run func tests (MPI)
9390
run: scripts/run_tests.py --running-type="processes" --counts 1 2 3 4 --additional-mpi-args="--oversubscribe"
9491
env:
@@ -114,13 +111,10 @@ jobs:
114111
steps:
115112
- uses: actions/checkout@v6
116113
- name: Download installed package
117-
uses: actions/download-artifact@v8
114+
uses: ./.github/actions/download-install
118115
with:
116+
path: install
119117
name: ubuntu-gcc-install-${{ matrix.os }}
120-
- name: Extract installed package
121-
run: |
122-
mkdir -p install
123-
tar -xzvf ubuntu-gcc-install-${{ matrix.os }}.tar.gz -C install
124118
- name: Run func tests (threads extended)
125119
run: scripts/run_tests.py --running-type="threads" --counts 5 7 11 13
126120
env:
@@ -184,13 +178,10 @@ jobs:
184178
steps:
185179
- uses: actions/checkout@v6
186180
- name: Download installed package
187-
uses: actions/download-artifact@v8
181+
uses: ./.github/actions/download-install
188182
with:
183+
path: install
189184
name: ubuntu-clang-install-${{ matrix.os }}
190-
- name: Extract installed package
191-
run: |
192-
mkdir -p install
193-
tar -xzvf ubuntu-clang-install-${{ matrix.os }}.tar.gz -C install
194185
- name: Run func tests (MPI)
195186
run: scripts/run_tests.py --running-type="processes" --counts 1 2 3 4 --additional-mpi-args="--oversubscribe"
196187
env:
@@ -216,13 +207,10 @@ jobs:
216207
steps:
217208
- uses: actions/checkout@v6
218209
- name: Download installed package
219-
uses: actions/download-artifact@v8
210+
uses: ./.github/actions/download-install
220211
with:
212+
path: install
221213
name: ubuntu-clang-install-${{ matrix.os }}
222-
- name: Extract installed package
223-
run: |
224-
mkdir -p install
225-
tar -xzvf ubuntu-clang-install-${{ matrix.os }}.tar.gz -C install
226214
- name: Run tests (threads extended)
227215
run: scripts/run_tests.py --running-type="threads" --counts 5 7 11 13
228216
env:
@@ -290,13 +278,10 @@ jobs:
290278
steps:
291279
- uses: actions/checkout@v6
292280
- name: Download installed package
293-
uses: actions/download-artifact@v8
281+
uses: ./.github/actions/download-install
294282
with:
283+
path: install
295284
name: ubuntu-clang-sanitizer-install-${{ matrix.os }}
296-
- name: Extract installed package
297-
run: |
298-
mkdir -p install
299-
tar -xzvf ubuntu-clang-sanitizer-install-${{ matrix.os }}.tar.gz -C install
300285
- name: Run tests (MPI)
301286
run: scripts/run_tests.py --running-type="processes" --counts 2 --additional-mpi-args="--oversubscribe"
302287
env:
@@ -328,13 +313,10 @@ jobs:
328313
steps:
329314
- uses: actions/checkout@v6
330315
- name: Download installed package
331-
uses: actions/download-artifact@v8
316+
uses: ./.github/actions/download-install
332317
with:
318+
path: install
333319
name: ubuntu-clang-sanitizer-install-${{ matrix.os }}
334-
- name: Extract installed package
335-
run: |
336-
mkdir -p install
337-
tar -xzvf ubuntu-clang-sanitizer-install-${{ matrix.os }}.tar.gz -C install
338320
- name: Run tests (threads extended)
339321
run: scripts/run_tests.py --running-type="threads" --counts 5 7 11 13
340322
env:

.github/workflows/windows.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ jobs:
5959
- uses: actions/checkout@v6
6060
- uses: ./.github/actions/setup-windows-toolchain
6161
- name: Download installed package
62-
uses: actions/download-artifact@v8
62+
uses: ./.github/actions/download-install
6363
with:
64+
path: install
6465
name: windows-msvc-install
65-
- name: Extract installed package
66-
run: Expand-Archive -Path .\windows-msvc-install.zip -DestinationPath . -Force
67-
shell: pwsh
6866
- name: Run func tests (MPI)
6967
run: scripts/run_tests.py --running-type="processes" --counts 1 2 3 4
7068
env:
@@ -84,12 +82,10 @@ jobs:
8482
- uses: actions/checkout@v6
8583
- uses: ./.github/actions/setup-windows-toolchain
8684
- name: Download installed package
87-
uses: actions/download-artifact@v8
85+
uses: ./.github/actions/download-install
8886
with:
87+
path: install
8988
name: windows-msvc-install
90-
- name: Extract installed package
91-
run: Expand-Archive -Path .\windows-msvc-install.zip -DestinationPath . -Force
92-
shell: pwsh
9389
- name: Run tests (threads extended)
9490
run: scripts/run_tests.py --running-type="threads" --counts 5 7 11 13
9591
env:
@@ -147,12 +143,10 @@ jobs:
147143
- uses: actions/checkout@v6
148144
- uses: ./.github/actions/setup-windows-toolchain
149145
- name: Download installed package
150-
uses: actions/download-artifact@v8
146+
uses: ./.github/actions/download-install
151147
with:
148+
path: install
152149
name: windows-clang-install
153-
- name: Extract installed package
154-
run: Expand-Archive -Path .\windows-clang-install.zip -DestinationPath . -Force
155-
shell: pwsh
156150
- name: Run tests (threads)
157151
run: scripts/run_tests.py --running-type="threads" --counts 1 2 3 4
158152
env:
@@ -168,12 +162,10 @@ jobs:
168162
- uses: actions/checkout@v6
169163
- uses: ./.github/actions/setup-windows-toolchain
170164
- name: Download installed package
171-
uses: actions/download-artifact@v8
165+
uses: ./.github/actions/download-install
172166
with:
167+
path: install
173168
name: windows-clang-install
174-
- name: Extract installed package
175-
run: Expand-Archive -Path .\windows-clang-install.zip -DestinationPath . -Force
176-
shell: pwsh
177169
- name: Run tests (threads extended)
178170
run: scripts/run_tests.py --running-type="threads" --counts 5 7 11 13
179171
env:

0 commit comments

Comments
 (0)