-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (77 loc) · 2.5 KB
/
matrix-test.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
name: Juno (build & deploy all apps)
on:
push:
branches:
- gh-matrix
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# On release creation
# release:
# types: [created]
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "tests&deployments"
cancel-in-progress: true
# Default to bash
defaults:
run:
shell: bash
jobs:
collect_info:
runs-on: [ubuntu-latest]
outputs:
apps: ${{ steps.collect-apps.outputs.apps }}
paths: ${{ steps.collect-apps.outputs.paths }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Collect apps
id: collect-apps
run: |
echo "apps=$(ls -d ./apps/*/ | jq --raw-input --slurp --compact-output 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT}
echo "paths=$(ls -d ./apps/*/ | sed 's/^\.\///' | sed 's/$/**/' | jq --raw-input --slurp --compact-output 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT}
- name: Show outputs
run: |
echo "===================="
echo ${{ steps.collect-apps.outputs.apps }}
echo "===================="
echo ${{ steps.collect-apps.outputs.paths }}
echo "===================="
changes:
needs: collect_info
runs-on: [ubuntu-latest]
outputs:
apps: ${{ steps.filter.outputs.apps }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
list-files: shell
filters: |
apps: [ "apps/exampleapp/**" ]
- name: Show outputs
run: |
echo "===================="
echo ${{ steps.filter.outputs.apps}}
echo "===================="
echo ${{ steps.filter.outputs.apps_files}}
echo "===================="
echo ${{fromJson(needs.collect_info.outputs.paths)}}
echo ${{needs.collect_info.outputs.paths}}
echo "===================="
# apps:
# needs: changes
# if: ${{ needs.changes.outputs.apps == 'true' }}
# runs-on: [ubuntu-latest]
# steps:
# - run: echo ${{ needs.changes.outputs.apps }}
# run_test:
# needs: collect_info
# runs-on: [ubuntu-latest]
# strategy:
# matrix:
# apps: ${{fromJson(needs.collect_info.outputs.apps)}}
# steps:
# - run: echo ${{ matrix.apps }}