-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (87 loc) · 3.05 KB
/
workflow-exp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# This is a basic workflow to help you get started with Actions
# https://github.com/latex3/hyperref/blob/adc36adbc3650db73329469b43afb0ee86e3c807/.github/workflows/main.yaml
# https://github.com/josephwright/siunitx/blob/main/.github/workflows/main.yaml
name: Workflow exps
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches:
- "*"
pull_request:
branches:
- "*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
things:
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
outputs:
mod_a_output: ${{ steps.build_ret.outputs.build_ret_moda }}
mod_b_output: ${{ steps.build_ret.outputs.build_ret_modb }}
mod_c_output: ${{ steps.build_ret.outputs.build_ret_modc }}
# don't abandon other builds if one module fails
# continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
- module: mod-a
mod_id: moda
my_result: false
- module: mod-b
mod_id: modb
my_result: false
- module: mod-c
mod_id: modc
my_result: true
name: "Test build: ${{ matrix.module }}"
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Update system
run: sudo apt-get update
- name: Return
id: build_ret
run: |
# buildret="${{ steps.thing.outputs.build_ret }}"
buildret="${{ matrix.my_result }}"
modid="${{ matrix.mod_id }}"
if [ "$buildret" == "true" ]
then
echo -e "BUILD_RET=0" >> "$GITHUB_OUTPUT"
echo -e "build_ret_${modid}=0" >> "$GITHUB_OUTPUT"
else
echo -e "BUILD_RET=1" >> "$GITHUB_OUTPUT"
echo -e "build_ret_${modid}=1" >> "$GITHUB_OUTPUT"
ls holly
fi
cat "$GITHUB_OUTPUT"
- name: Archive failed build output
if: ${{ !cancelled() && !(steps.build_ret.outputs.BUILD_RET) }}
uses: actions/upload-artifact@v4
with:
name: buildfiles-${{ matrix.module }}
path: fontscripts/*.lua
retention-days: 1
summary:
name: summary
needs: things
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: Summarise
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idoutputs
env:
reta: ${{ needs.things.outputs.moda_output }}
retb: ${{ needs.things.outputs.modb_output }}
retc: ${{ needs.things.outputs.modc_output }}
run: |
outmoda="${{ reta }}"
outmodb="${{ retb }}"
outmodc="${{ retc }}"
("[[ $outmoda != 0 || $outmodb != 0 || $outmodc != 0 ]]" && echo -e "BUILD_RET=1" >> "$GITHUB_OUTPUT") || echo -e "BUILD_RET=0" >> "$GITHUB_OUTPUT"
cat "$GITHUB_OUTPUT"
# vim: sw=2:et:ts=2: