-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (65 loc) · 1.77 KB
/
ci.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
name: CI
on:
push:
pull_request:
branches:
- main
- master
permissions: read-all
jobs:
Mega-Linter:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
# For GitHub Comment Reporter
# https://megalinter.io/latest/reporters/GitHubCommentReporter/
steps:
- uses: actions/checkout@v4
# Mega-Linter
- name: Mega-Linter
id: ml
# You can override Mega-Linter flavor used to have faster performances
# More info at https://megalinter.io/flavors/
uses: oxsecurity/megalinter/flavors/go@v8
env:
# All available variables are described in documentation
# https://megalinter.io/config-file/
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload Mega-Linter artifacts
- name: Archive production artifacts
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: Mega-Linter reports
path: |
megalinter-reports
mega-linter.log
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version:
- "1.18"
- "1.19"
- "1.20"
- "1.21"
- "1.22"
- "1.23"
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: "${{ matrix.go-version }}"
- name: Test
run: |
go test -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}