-
Notifications
You must be signed in to change notification settings - Fork 577
43 lines (35 loc) · 1.01 KB
/
backend_test.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
---
name: Backend Go Tests
"on":
push:
branches: ['develop']
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Download Go
uses: actions/setup-go@v5
with:
go-version: 1.21.1
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Test that the docker image still builds successfully
run: |
export COMMIT_SHA=$(git rev-parse --short HEAD)
docker build -t testingbuild:latest --build-arg COMMIT_SHA=${COMMIT_SHA} . -f Dockerfile_backend
- name: Deps
run: go get -v ./...
working-directory: backend
- name: Build
run: go build
working-directory: backend
- name: Test
run: |
go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
go test -json ./... | gotestfmt
env:
GITHUB_PAT_TOKEN: ${{ secrets.TOKEN_GITHUB }}
working-directory: backend