forked from lablabs/cloudflare-exporter
-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (80 loc) · 2.16 KB
/
golang.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
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
name: Go Checks
on:
push:
branches:
- '**'
paths:
- 'go.sum'
- 'go.mod'
- '**.go'
- .github/workflows/golang.yml
- '.goreleaser.yml'
- 'run_e2e.sh'
pull_request:
branches:
- master
permissions:
security-events: write
actions: write
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Test:
runs-on: ubuntu-latest
env:
GO111MODULE: on
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install Vemon
run: |
curl https://github.com/ovh/venom/releases/download/v1.2.0/venom.linux-amd64 -L -o /usr/local/bin/venom && chmod +x /usr/local/bin/venom
venom version
- name: Test
run: make test
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
cloudflare_exporter_test_output
vemon.log
Snapshot:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install syft
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
syft version
- name: GoReleaser Action
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: --snapshot --clean --skip=publish,sign
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets
uses: actions/upload-artifact@v4
with:
name: cloudflare-exporter
path: dist/*