-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (51 loc) · 1.57 KB
/
test.yaml
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
name: Dynamic Test Execution
on: [push]
jobs:
prepare-execution-matrix:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Prepare Execution Matrix
id: set-matrix
run: |
EXEC_FILES=$(find test -type f -executable | jq -R -s -c 'split("\n")[:-1]')
echo 'MATRIX<<EOF' >> $GITHUB_OUTPUT
echo $EXEC_FILES >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.set-matrix.outputs.MATRIX }}
execute-scripts:
needs: prepare-execution-matrix
runs-on: ubuntu-latest
strategy:
matrix:
script: ${{ fromJson(needs.prepare-execution-matrix.outputs.matrix) }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v5
with:
# cache: 'pip'
python-version: '3.x'
- id: setup-env
name: Set up Bun
run: |
mkdir -p -- "$(pip cache dir)"
curl -fsSL https://bun.sh/install | bash
echo "$HOME/.bun/bin" >> $GITHUB_PATH
echo "TEST_NAME=${TEST_SCRIPT//\//-}" >> $GITHUB_OUTPUT
env:
TEST_SCRIPT: ${{ matrix.script }}
- name: Execute Script
run: ./${{ matrix.script }}
- name: Upload Output
if: always()
uses: actions/upload-artifact@v4
with:
name: output-${{ steps.setup-env.outputs.TEST_NAME }}
path: ./test/output