-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (45 loc) · 1.71 KB
/
pull_request.yaml
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
on:
pull_request:
push:
branches:
- master
- qa
- uat
jobs:
test:
runs-on: ubuntu-latest
container: golang:1.23-alpine
env:
ENVIRONMENT: ci
steps:
- uses: actions/checkout@v4
- run: apk update && apk add curl openssl git openssh-client build-base && mkdir -p /root/.ssh
- run: wget -O /usr/bin/mockgen https://github.com/skynet2/mock/releases/latest/download/mockgen && chmod 777 /usr/bin/mockgen
- run: go test -json -coverprofile=/root/coverage_temp.txt -covermode=atomic ./... > /root/test.json
- run: cat /root/coverage_temp.txt | grep -v "_mock.go" | grep -v "_mocks.go" | grep -v "_mocks_test.go" | grep -v "_mock_test.go" > /root/coverage.txt || true
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /root/coverage.txt
if: (!(startsWith(github.event.pull_request.title, 'Deploy to')))
- run: cat /root/test.json
if: always()
- run: wget https://github.com/mfridman/tparse/releases/latest/download/tparse_linux_x86_64 -O tparse && chmod 777 tparse && ./tparse -all -file=/root/test.json
if: always()
- uses: guyarb/[email protected]
if: always()
with:
test-results: /root/test.json
lint:
runs-on: ubuntu-latest
container: golang:1.23-alpine
env:
ENVIRONMENT: ci
steps:
- uses: actions/checkout@v4
- uses: golangci/[email protected]
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/qa' && github.ref != 'refs/heads/uat'
with:
version: latest
args: --timeout=5m --tests=false ./...