refactor: extract archtectures to yml

Opens the door to running the same matrix across multiple jobs.

PR: #41
This commit is contained in:
innovaker 2021-05-14 19:12:34 +01:00
parent dcdbf26dc6
commit 79d41ac9e5
2 changed files with 20 additions and 3 deletions

View File

@ -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
View File

@ -0,0 +1 @@
- arm