refactor: extract archtectures to yml
Opens the door to running the same matrix across multiple jobs. PR: #41
This commit is contained in:
parent
dcdbf26dc6
commit
79d41ac9e5
20
.github/workflows/containers.yml
vendored
20
.github/workflows/containers.yml
vendored
@ -13,13 +13,29 @@ on:
|
|||||||
concurrency: ${{ github.workflow }}
|
concurrency: ${{ github.workflow }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
architectures:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
json: ${{ steps.import.outputs.json }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Import from architectures.yml
|
||||||
|
id: import
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
import yaml, json
|
||||||
|
with open('architectures.yml', 'r') as file:
|
||||||
|
architectures = yaml.safe_load(file)
|
||||||
|
print('::set-output name=json::' + json.dumps(architectures))
|
||||||
docker:
|
docker:
|
||||||
|
needs:
|
||||||
|
- architectures
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
max-parallel: 1 # takes advantage of caching between jobs
|
max-parallel: 1 # takes advantage of caching between jobs
|
||||||
matrix:
|
matrix:
|
||||||
architecture:
|
architecture: ${{ fromJSON(needs.architectures.outputs.json) }}
|
||||||
- arm
|
|
||||||
target: # ordered from biggest to smallest to take advantage of the registry cache
|
target: # ordered from biggest to smallest to take advantage of the registry cache
|
||||||
- dev
|
- dev
|
||||||
- build
|
- build
|
||||||
|
1
architectures.yml
Normal file
1
architectures.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
- arm
|
Loading…
Reference in New Issue
Block a user