-
Notifications
You must be signed in to change notification settings - Fork 43
58 lines (49 loc) · 1.39 KB
/
v1-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
name: omise-go v1
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
WORKDIR: src/github.com/${{ github.repository }}
strategy:
matrix:
go: [ '1.21', '1.20', '1.19', '1.18', '1.17' ]
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
cache: false
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0
path: ${{ env.WORKDIR }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
working-directory: ${{ env.WORKDIR }}
- name: Build
working-directory: ${{ env.WORKDIR }}
run: .github/scripts/setup.sh
- name: Test
working-directory: ${{ env.WORKDIR }}
env:
OMISE_PKEY: pkey_test_xxx
OMISE_SKEY: skey_test_xxx
GOPATH: ${{ github.workspace }}
run: .github/scripts/test.sh
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
if: matrix.go == '1.21'
with:
projectBaseDir: ${{ env.WORKDIR }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}