Skip to content

Commit b339a45

Browse files
committed
gha: split reusable component to impl.yml
1 parent 1afc30a commit b339a45

File tree

2 files changed

+68
-46
lines changed

2 files changed

+68
-46
lines changed

.github/workflows/build.yml

+10-46
Original file line numberDiff line numberDiff line change
@@ -16,53 +16,17 @@ jobs:
1616
outputs:
1717
matrix: ${{ steps.set-matrix.outputs.matrix }}
1818

19-
test_implementations:
20-
name: ${{ matrix.implementation }}-${{ matrix.platform }}-py${{ matrix.python-version }}-${{ matrix.zarr-python }}
21-
runs-on: ${{ matrix.platform }}
19+
test_implementations_released:
2220
needs: get_implementations
21+
uses: ./.github/workflows/impl.yml
22+
with:
23+
implementations: ${{ needs.get_implementations.outputs.matrix}}
24+
python: released
2325

24-
strategy:
25-
fail-fast: false
26-
matrix:
27-
platform: [ubuntu-latest]
28-
python-version: [3.9]
29-
implementation: ${{ fromJson(needs.get_implementations.outputs.matrix) }}
30-
zarr-python: [released]
31-
32-
steps:
33-
- name: Checkout
34-
uses: actions/checkout@v3
35-
36-
- name: Setup miniconda
37-
uses: conda-incubator/setup-miniconda@v1
38-
with:
39-
auto-update-conda: true
40-
channels: conda-forge,ome
41-
environment-file: implementations/${{ matrix.implementation }}/environment.yml
42-
python-version: ${{ matrix.python-version }}
43-
env:
44-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
45-
46-
- name: Install zarr dev (optional)
47-
shell: bash -l {0}
48-
if: ${{ matrix.config.zarr-python == 'pre' }}
49-
run: |
50-
python -m pip install git+https://github.com/zarr-developers/zarr-python.git
51-
52-
- name: Cache local Maven repository
53-
uses: actions/cache@v2
54-
with:
55-
path: ~/.m2/repository
56-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
57-
restore-keys: |
58-
${{ runner.os }}-maven-
59-
60-
- name: Run tests
61-
shell: bash -l {0}
62-
run: make implementations/${{ matrix.implementation }}
63-
26+
# Re-run the same configurations but with a pre-release of Zarr
6427
test_implementations_pre:
65-
uses: ./github/workflows/build.yml
66-
needs: test_implementations
28+
needs: test_implementations_released
29+
uses: ./.github/workflows/impl.yml
6730
with:
68-
python: [pre]
31+
implementations: ${{ needs.get_implementations.outputs.matrix}}
32+
python: pre

.github/workflows/impl.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Implementation tests
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
implementations:
8+
required: true
9+
type: string
10+
python:
11+
required: true
12+
type: string
13+
14+
jobs:
15+
16+
test_implementations:
17+
name: ${{ matrix.implementation }}-${{ matrix.platform }}-py${{ matrix.python-version }}-${{ matrix.zarr-python }}
18+
runs-on: ${{ matrix.platform }}
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
platform: [ubuntu-latest]
24+
python-version: [3.9]
25+
implementation: ${{ fromJson(implementations) }}
26+
zarr-python: [${{ python }}]
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v3
31+
32+
- name: Setup miniconda
33+
uses: conda-incubator/setup-miniconda@v1
34+
with:
35+
auto-update-conda: true
36+
channels: conda-forge,ome
37+
environment-file: implementations/${{ matrix.implementation }}/environment.yml
38+
python-version: ${{ matrix.python-version }}
39+
env:
40+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
41+
42+
- name: Install zarr dev (optional)
43+
shell: bash -l {0}
44+
if: ${{ matrix.config.zarr-python == 'pre' }}
45+
run: |
46+
python -m pip install git+https://github.com/zarr-developers/zarr-python.git
47+
48+
- name: Cache local Maven repository
49+
uses: actions/cache@v2
50+
with:
51+
path: ~/.m2/repository
52+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
53+
restore-keys: |
54+
${{ runner.os }}-maven-
55+
56+
- name: Run tests
57+
shell: bash -l {0}
58+
run: make implementations/${{ matrix.implementation }}

0 commit comments

Comments
 (0)