Skip to content

Commit 51bbe8d

Browse files
committed
cicd: abstract action test to own workflow.
1 parent 07210a2 commit 51bbe8d

File tree

2 files changed

+31
-25
lines changed

2 files changed

+31
-25
lines changed

.github/workflows/action.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Action Test
2+
on:
3+
pull_request:
4+
push:
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Dispatch and return Run ID
12+
id: return_dispatch
13+
uses: ./
14+
with:
15+
token: ${{ secrets.TOKEN }}
16+
ref: ${{ github.ref }}
17+
repo: return-dispatch
18+
owner: codex-
19+
workflow: dispatch.yml
20+
workflow_inputs: '{"cake":"delicious"}'
21+
workflow_timeout_seconds: 30
22+
- name: Evaluate that the Run ID output has been set
23+
run: |
24+
if [ "${{ steps.return_dispatch.outputs.run_id }}" == "" ]; then
25+
echo "Failed to return Run ID"
26+
exit 1
27+
fi
28+
- name: Output fetched Run ID
29+
run: echo ${{ steps.return_dispatch.outputs.run_id }}

.github/workflows/test.yml

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build-test
1+
name: Build
22
on:
33
pull_request:
44
push:
@@ -21,31 +21,8 @@ jobs:
2121
- name: style
2222
if: ${{ always() }}
2323
run: npm run format:check
24-
test:
25-
runs-on: ubuntu-latest
26-
steps:
27-
- uses: actions/checkout@v3
28-
- name: Dispatch and return Run ID
29-
id: return_dispatch
30-
uses: ./
31-
with:
32-
token: ${{ secrets.TOKEN }}
33-
ref: ${{ github.ref }}
34-
repo: return-dispatch
35-
owner: codex-
36-
workflow: dispatch.yml
37-
workflow_inputs: '{"cake":"delicious"}'
38-
workflow_timeout_seconds: 30
39-
- name: Evaluate that the Run ID output has been set
40-
run: |
41-
if [ "${{ steps.return_dispatch.outputs.run_id }}" == "" ]; then
42-
echo "Failed to return Run ID"
43-
exit 1
44-
fi
45-
- name: Output fetched Run ID
46-
run: echo ${{ steps.return_dispatch.outputs.run_id }}
4724
codecov: # Send only a single coverage report per run
48-
needs: [build, test]
25+
needs: [build]
4926
timeout-minutes: 15
5027
env:
5128
CI: true

0 commit comments

Comments
 (0)