-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (52 loc) · 1.56 KB
/
check.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
on: pull_request
name: Check Commit
env:
GOPRIVATE: github.com/OpsHelmInc/*
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
jobs:
check_commit:
name: Check Commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.20.0'
- name: Get Go cache paths
id: cache-path
run: |
echo "build=$(go env GOCACHE)" >>"$GITHUB_OUTPUT"
echo "module=$(go env GOMODCACHE)" >>"$GITHUB_OUTPUT"
shell: bash
- name: Setup Cache
uses: actions/cache@v3
with:
path: |
${{ steps.cache-path.outputs.build }}
${{ steps.cache-path.outputs.module }}
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
- name: Setup SSH Keys and known_hosts
run: |
ssh-agent -a $SSH_AUTH_SOCK
echo '${{ secrets.OH_DEPLOY_KEY }}' | base64 --decode > deploy-key
chmod 600 deploy-key
ssh-add deploy-key
ssh-add -l
git config --global url."ssh://[email protected]/OpsHelmInc".insteadOf "https://github.com/OpsHelmInc"
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
- name: Install Tools
run: make install-tools
- name: Gen
run: make gen
- name: Fail if generation updated files
run: test "$(git status -s | wc -l)" -eq 0 || (git status -s; exit 1)
- name: Check
run: make test
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.2
args: --timeout=5m