Repository navigation
45 lines (38 loc) · 1.4 KB
/
Copy pathci.yml
File metadata and controls
45 lines (38 loc) · 1.4 KB
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
name: Go Deploy CLI SDK CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs: {}
jobs:
integrate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version: '1.26'
# Install global Go dependencies
- name: Install Go Global Dependencies
run: go install honnef.co/go/tools/cmd/staticcheck@latest && go get -u gopkg.in/check.v1 && go get -u golang.org/x/sys/unix
# SonarCloud scan runs in a docker container where the workspace directory gets mounted to /github/workspace
# so we need to replace all references to the github workspace directory with /github/workspace.
- name: Linting
run: >
export PATH=$PATH:$(go env GOPATH)/bin && bash scripts/lint.sh &&
sed -i 's#${{ github.workspace }}#/github/workspace#g' govet-report.out &&
sed -i 's#${{ github.workspace }}#/github/workspace#g' staticcheck.out
- name: Run Tests (with integration)
run: bash scripts/run-tests.sh --integration
env:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v7.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}