-
Notifications
You must be signed in to change notification settings - Fork 126
33 lines (33 loc) · 1.46 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
name: Default CI
on: [push, pull_request, workflow_dispatch]
jobs:
# This workflow contains a job called "test", which is run on every push
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ^1.18
cache: true
- name: Setup toxiproxy
run: |
wget -O toxiproxy-2.1.4.deb https://github.com/Shopify/toxiproxy/releases/download/v2.1.4/toxiproxy_2.1.4_amd64.deb
sudo dpkg -i toxiproxy-2.1.4.deb
sudo cp ws/toxiproxy.service /lib/systemd/system/
sudo systemctl start toxiproxy
- name: Run tests
run: |
go test ./ws ./ocppj -v -covermode=count -coverprofile=coverage.out
go test -v -covermode=count -coverprofile=ocpp16.out -coverpkg=github.com/lorenzodonini/ocpp-go/ocpp1.6/... github.com/lorenzodonini/ocpp-go/ocpp1.6_test
go test -v -covermode=count -coverprofile=ocpp201.out -coverpkg=github.com/lorenzodonini/ocpp-go/ocpp2.0.1/... github.com/lorenzodonini/ocpp-go/ocpp2.0.1_test
sed '1d;$d' ocpp16.out >> coverage.out
sed '1d;$d' ocpp201.out >> coverage.out
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Publish coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=coverage.out -service=github