Some checks failed
shared matrix / test (18, bookworm) (push) Failing after 22s
shared matrix / test (18, bullseye) (push) Failing after 2s
shared matrix / test (20, bookworm) (push) Failing after 2s
shared matrix / test (20, bullseye) (push) Failing after 2s
shared matrix / define-matrix (push) Successful in 0s
shared matrix / produce-artifacts (push) Failing after 1s
shared matrix / consume-artifacts (push) Has been skipped
67 lines
1.3 KiB
YAML
67 lines
1.3 KiB
YAML
name: shared matrix
|
|
on:
|
|
push:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
|
|
test:
|
|
runs-on: nix
|
|
strategy:
|
|
matrix:
|
|
variant: ['bookworm', 'bullseye']
|
|
node: ['18', '20']
|
|
steps:
|
|
- uses: https://code.forgejo.org/actions/setup-node@v4
|
|
with:
|
|
node-version: '${{ matrix.node }}'
|
|
|
|
define-matrix:
|
|
runs-on: nix
|
|
|
|
outputs:
|
|
colors: ${{ steps.colors.outputs.colors }}
|
|
|
|
steps:
|
|
- name: Define Colors
|
|
id: colors
|
|
run: |
|
|
echo 'colors=["red", "green", "blue"]' >> "$FORGEJO_OUTPUT"
|
|
|
|
produce-artifacts:
|
|
runs-on: nix
|
|
needs: define-matrix
|
|
strategy:
|
|
matrix:
|
|
color: ${{ fromJSON(needs.define-matrix.outputs.colors) }}
|
|
|
|
steps:
|
|
- name: Define Color
|
|
env:
|
|
color: ${{ matrix.color }}
|
|
run: |
|
|
echo "$color" > color
|
|
- name: Produce Artifact
|
|
uses: forgejo/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.color }}
|
|
path: color
|
|
|
|
consume-artifacts:
|
|
runs-on: nix
|
|
needs:
|
|
- define-matrix
|
|
- produce-artifacts
|
|
strategy:
|
|
matrix:
|
|
color: ${{ fromJSON(needs.define-matrix.outputs.colors) }}
|
|
|
|
steps:
|
|
- name: Retrieve Artifact
|
|
uses: forgejo/download-artifact@v5
|
|
with:
|
|
name: ${{ matrix.color }}
|
|
|
|
- name: Report Color
|
|
run: |
|
|
cat color
|