Skip to content

Commit e4cf6e4

Browse files
shenxianpeng2bndy5
andauthored
Automatically triggers test action and waits for test results before merged (#71)
* Trigger test actions automatically * Trigger workflow in parallel * Only trigger test workflow on the master branch * Add the latest tag for testing * Update .github/workflows/run-test.yml Co-authored-by: Brendan <[email protected]> * fix empty ident name Co-authored-by: Brendan <[email protected]>
1 parent dc71f8c commit e4cf6e4

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/run-test.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: "Test action and package"
2+
3+
on:
4+
push:
5+
branches: master
6+
paths-ignore: "docs/**"
7+
pull_request:
8+
branches: master
9+
paths-ignore: "docs/**"
10+
11+
jobs:
12+
add-tag:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
- name: retag latest commit for testing
18+
run: |
19+
git config user.name 'github-actions'
20+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
21+
git push --delete origin latest || true
22+
git tag -a latest -m 'Retag latest commit'
23+
git push origin latest
24+
25+
test-action:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: convictional/[email protected]
29+
with:
30+
owner: cpp-linter
31+
repo: test-cpp-linter-action
32+
github_token: ${{ secrets.PAT_TOKEN }}
33+
workflow_file_name: cpp-lint-action.yml
34+
ref: master
35+
wait_interval: 10
36+
client_payload: '{}'
37+
propagate_failure: true
38+
trigger_workflow: true
39+
wait_workflow: true
40+
test-package:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: convictional/[email protected]
44+
with:
45+
owner: cpp-linter
46+
repo: test-cpp-linter-action
47+
github_token: ${{ secrets.PAT_TOKEN }}
48+
workflow_file_name: cpp-lint-package.yml
49+
ref: master
50+
wait_interval: 10
51+
client_payload: '{}'
52+
propagate_failure: true
53+
trigger_workflow: true
54+
wait_workflow: true

0 commit comments

Comments
 (0)