-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (94 loc) · 2.24 KB
/
main.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI
on:
push:
pull_request:
branches: [ $default-branch ]
release:
types:
- created
jobs:
test:
name: CI
runs-on: ubuntu-latest
strategy:
matrix:
otp: [27.0, 27.1]
container:
image: erlang:${{ matrix.otp }}-alpine
options: --privileged
services:
nats:
image: nats:latest
ports:
- 4222:4222
steps:
-
name: Prepare
run: |
apk update
apk --no-cache upgrade
apk --no-cache add git zstd
-
name: Check out repository
uses: actions/checkout@v4
-
name: Build
run: rebar3 compile
-
name: Run tests
run: |
rebar3 xref
rebar3 dialyzer
rebar3 ct
-
name: Tar Test Output
if: ${{ always() }}
run: tar -cf - _build/test/logs/ | zstd -15 -o ct-logs-${{ matrix.otp }}.tar.zst
-
name: Archive Test Output
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: test-output-${{ matrix.otp }}
path: |
ct-logs-${{ matrix.otp }}.tar.zst
_build/test/logs/*/junit_report.xml
publish-test-results:
name: "Publish Tests Results"
needs: test
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
contents: read
issues: read
if: always()
steps:
-
name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
-
name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: "artifacts/**/junit_report.xml"
slack:
needs: test
runs-on: ubuntu-22.04
if: always()
steps:
-
name: Slack notification
uses: 8398a7/action-slack@v3
with:
author_name: "GitHub Actions"
username: ${{ github.event.repository.name }}
icon_emoji: ':octocat:'
fields: repo, message, ref, commit, author, action, eventName, workflow, job, took
status: ${{ needs.test.result }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}