-
Notifications
You must be signed in to change notification settings - Fork 3
90 lines (84 loc) · 2.21 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: CI
on:
push:
branches:
- "**"
env:
GO_VERSION: 1.22
permissions:
id-token: write
contents: write
jobs:
lint:
name: Lint Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/setup-python@v5
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: golangci/golangci-lint-action@v6
with:
version: v1.62
- run: |
pip install -r requirements.txt
mkdocs build -f ../../mkdocs.yaml --strict
pip uninstall -r requirements.txt --yes --no-input
working-directory: tests/docs
- run: npx prettier . --check
test:
name: Test
needs: [lint, snyk]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1.7.0
with:
role-to-assume: ${{ secrets.ROLE_TO_ASSUME }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ secrets.AWS_REGION }}
- run: make test
snyk:
name: Snyk Scan
runs-on: ubuntu-latest
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: snyk/actions/setup@master
- run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
working-directory: tests/docs
- run: >-
snyk test
--severity-threshold=medium
--all-projects
- run: >-
snyk code test
--severity-threshold=medium
--all-projects
release:
name: Release
needs: [test, snyk]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.8.1
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.PAT_SEMANTIC_RELEASE }}