-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (82 loc) · 2.44 KB
/
pr-checks.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
91
92
93
94
95
96
97
98
99
name: Checks
on:
pull_request:
branches: ["main"]
push:
branches: ["main"]
env:
TR_DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
jobs:
smoke-test:
name: Smoke Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run default Setup
run: |
make farm-release-pull || echo "no release asset found, skipping."
make docker-init docker-build docker-run
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
- name: API Health Check
uses: jtalk/url-health-check-action@v3
with:
url: http://localhost:3000/v0/healthcheck
max-attempts: 90
retry-delay: 1s
retry-all: true
- name: Print container logs
if: failure()
run: |
echo Printing terrarium-api container logs
docker logs terrarium-api || echo ""
echo Printing postgres container logs
docker logs postgres || echo ""
- name: Check harvest script
run: |
rm -f data/cc_terrarium.psql
make docker-stop-clean docker-harvest
sonarcloud:
name: SonarCloud
needs: unit-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Download code coverage results
uses: actions/download-artifact@v3
with:
name: code-coverage-report
path: coverage
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
unit-test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run unit tests
run: |
make docker-init docker-api-test
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: coverage
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
check-headers:
name: Check Copyright Headers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Copywrite
uses: hashicorp/setup-copywrite@v1.1.2
with:
version: v0.16.4
- name: Check Header Compliance
run: copywrite headers --plan