Skip to content

Commit 85ee2d9

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

File tree

2 files changed

+79
-41
lines changed

2 files changed

+79
-41
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -16,53 +16,35 @@ 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 }}
22-
needs: get_implementations
23-
19+
test_implementations_released:
2420
strategy:
2521
fail-fast: false
2622
matrix:
23+
implementation: ${{ fromJson(needs.get_implementations.outputs.matrix) }}
2724
platform: [ubuntu-latest]
2825
python-version: [3.9]
29-
implementation: ${{ fromJson(needs.get_implementations.outputs.matrix) }}
3026
zarr-python: [released]
27+
needs: get_implementations
28+
uses: ./.github/workflows/impl.yml
29+
with:
30+
implementation: ${{ matrix.implementation }}
31+
platform: ${{ matrix.platform }}
32+
python-version: ${{ matrix.python-version }}
33+
zarr-python: ${{ matrix.zarr-python }}
3134

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-
35+
# Re-run the same configurations but with a pre-release of Zarr
6436
test_implementations_pre:
65-
uses: ./github/workflows/build.yml
66-
needs: test_implementations
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
implementation: ${{ fromJson(needs.get_implementations.outputs.matrix) }}
41+
platform: [ubuntu-latest]
42+
python-version: [3.9]
43+
zarr-python: [pre]
44+
needs: test_implementations_released
45+
uses: ./.github/workflows/impl.yml
6746
with:
68-
python: [pre]
47+
implementation: ${{ matrix.implementation }}
48+
platform: ${{ matrix.platform }}
49+
python-version: ${{ matrix.python-version }}
50+
zarr-python: ${{ matrix.zarr-python }}

.github/workflows/impl.yml

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

0 commit comments

Comments
 (0)