-
Notifications
You must be signed in to change notification settings - Fork 33
124 lines (120 loc) · 4.65 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: CI
on:
push:
pull_request:
branches: [ $default-branch ]
release:
types:
- created
jobs:
test:
name: CI
runs-on: ubuntu-latest
strategy:
matrix:
otp: ["23.1", "23.2", "23.3", "24.0"]
fail-fast: false
container:
image: quay.io/travelping/alpine-erlang:${{ matrix.otp }}
options: --privileged
steps:
- name: Prepare
run: |
apk update
apk --no-cache upgrade
apk --no-cache add docker gcc git libc-dev libc-utils libgcc linux-headers make bash \
musl-dev musl-utils ncurses-dev pcre2 pkgconf scanelf wget zlib \
yaml-dev tzdata
- uses: actions/checkout@v2
- name: Build
run: rebar3 compile
- name: Prep for tests
run: |
sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
ip addr add fd96:dcd2:efdb:41c3::10:1/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::10:2/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::10:3/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::10:4/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::20:1/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::20:2/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::20:3/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::20:4/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::20:5/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::20:6/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::20:7/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::20:8/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::20:9/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::100:1/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::100:2/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::100:3/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::100:4/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::100:5/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::100:6/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::100:7/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::100:8/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::100:9/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::200:1/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::200:2/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::200:3/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::300:1/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::300:2/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::300:3/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::400:1/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::400:2/64 dev lo
ip addr add fd96:dcd2:efdb:41c3::400:3/64 dev lo
- name: Run tests
env:
CI_DNS_SERVER: 172.18.0.1
CI_RUN_SLOW_TESTS: true
run: |
docker run -d --rm \
--name=bind-dns \
--publish 172.18.0.1:53:53/udp \
--publish 172.18.0.1:53:53/tcp \
--publish 172.18.0.1:953:953/tcp \
quay.io/travelping/ergw-dns-test-server:latest
rebar3 do xref
rebar3 do ct
rebar3 do ct --name test@127.0.0.1 --suite=apps/ergw_core/test/pgw_dist_SUITE
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.otp }}
run: DEBUG=1 rebar3 as test coveralls send || /bin/true
- name: Archive Test Output
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-output-${{ matrix.otp }}
path: |
_build/test/logs/
!_build/test/logs/last
slack:
needs: test
runs-on: ubuntu-20.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) }}
finish:
needs: test
runs-on: ubuntu-20.04
if: always()
steps:
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -v -k https://coveralls.io/webhook \
--header "Content-Type: application/json" \
--data "{\"repo_name\":\"$GITHUB_REPOSITORY\",\"repo_token\":\"$GITHUB_TOKEN\",\"payload\":{\"build_num\":$GITHUB_RUN_ID,\"status\":\"done\"}}"