-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (48 loc) · 1.39 KB
/
ci.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
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
lint-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- "1.22"
env:
GOPRIVATE: github.com/reddit/achilles-sdk-api
container:
image: golang:${{ matrix.go-version }}
steps:
- uses: actions/checkout@v3
- name: Workaround Git Security Warning
run: |
# Workaround a bug in github actions:
# https://github.com/actions/runner-images/issues/6775.
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
known_hosts: ${{ secrets.KNOWN_HOSTS }}
key: ${{ secrets.GO_MODULE_PRIVATE_KEY }}
- name: Setup access for private Go modules
run: |
git config --global url."ssh://[email protected]/".insteadOf https://github.com/
- name: Generate
run: |
# needed for running `tar -xJv` for installing shellcheck
apt-get update
apt-get install xz-utils
make generate
git status
git diff
test -z "$(git status --porcelain)"
# lint code
make lint
git status
git diff
test -z "$(git status --porcelain)"
- name: Test
run: make test