-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (42 loc) · 1.38 KB
/
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
name: Test
on:
workflow_dispatch:
repository_dispatch:
types: [run-test]
jobs:
run-tests:
runs-on: self-hosted
steps:
- name: Set commit status as pending
uses: myrotvorets/set-commit-status-action@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ github.sha }}
status: pending
- name: Check out repository code
uses: actions/checkout@v3
- name: Run make test
id: run-test
run: |
set -o pipefail
make test 2>&1 | tee test-output.txt
- name: Extract test results to be published to Github Issue
if: failure() && steps.run-test.outcome == 'failure'
id: extract-results
run: |
echo 'TEST_OUTPUT<<EOF' >> $GITHUB_OUTPUT
cat test-output.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Create GitHub issue if test failed
if: failure() && steps.run-test.outcome == 'failure'
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST_OUTPUT: ${{ steps.extract-results.outputs.TEST_OUTPUT }}
- name: Set final commit status
if: always()
uses: myrotvorets/set-commit-status-action@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ github.sha }}
status: ${{ job.status }}