-
Notifications
You must be signed in to change notification settings - Fork 284
56 lines (54 loc) · 1.82 KB
/
go.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
name: Tests
on:
- push
- pull_request
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version: 1.23
- name: Checkout code
uses: actions/[email protected]
- name: Run golangci-lint
uses: golangci/[email protected]
- name: WriteGoList
run: go list -json -m all > go.list
- name: nancy
uses: sonatype-nexus-community/nancy-github-action@main
- name: Run Keycloak
run: |
make start-keycloak
sleep 15
- name: Unit Tests
run: |
go test -failfast -race -cover -coverprofile=coverage.txt -covermode=atomic -p 100 -cpu 1,2 -bench . -benchmem > test.log
cat test.log
- name: Failed Logs
if: failure()
run: |
cat test.log
docker ps
docker logs keycloak
- name: CodeCov
uses: codecov/[email protected]
with:
file: ./coverage.txt
# Publish benchmarks for the main branch only
- name: Store Benchmark Result
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: rhysd/[email protected]
with:
# What benchmark tool the output.txt came from
tool: "go"
# Where the output from the benchmark tool is stored
output-file-path: test.log
# Push and deploy GitHub pages branch automatically
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Updating go report card for main branch only
- name: GoReportCard
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: curl --fail --request POST "https://goreportcard.com/checks" --data "repo=github.com/Nerzal/gocloak"