-
Notifications
You must be signed in to change notification settings - Fork 58
71 lines (68 loc) · 2.12 KB
/
non-regression.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build container and validate lint/tests
on:
pull_request:
workflow_dispatch:
env:
GO_VERSION: '1.21'
jobs:
lint-validation:
name: Validate Go code linting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: --timeout=240s
unit-test-golang:
needs: lint-validation
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Run unit static tests
run: go test -v -race $(go list ./... | grep -v pkg/storage)
unit-test-golang-with-services:
needs: lint-validation
name: Unit tests with external services
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Build and run the docker stack
run: |
docker network create your_network || true
docker compose -f docker-compose.yml.test up -d --build --force-recreate --remove-orphans
- name: Run pkg storage tests
run: docker compose -f docker-compose.yml.test exec -T souin go test -v -race ./pkg/storage
validate-prod-container-building:
needs: unit-test-golang-with-services
name: Validate that the container build for prod
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v4
-
name: Build the stack
run: docker network create your_network || true
-
name: Build the stack
run: docker compose -f docker-compose.yml.prod up -d --build --force-recreate --remove-orphans
-
name: Souin container healthceck
run: docker compose -f docker-compose.yml.prod exec -T souin ls