-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.25 KB
/
tests.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
name: Run Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
env:
JWT_SECRET: ${{ secrets.JWT_SECRET }}
MONGO_URL: ${{ secrets.MONGO_URL }}
MONGO_DATABASE: ${{ secrets.MONGO_DATABASE }}
SERVER_ADDRESS: ${{ secrets.SERVER_ADDRESS }}
USER_COLLECTION: ${{ secrets.USER_COLLECTION }}
TASK_COLLECTION: ${{ secrets.TASK_COLLECTION }}
ALLOWED_USERS: ${{ secrets.ALLOWED_USERS }}
TEST_DATABASE: ${{ secrets.TEST_DATABASE }}
TEST_USER_COLLECTION: ${{ secrets.TEST_USER_COLLECTION }}
TEST_TASK_COLLECTION: ${{ secrets.TEST_TASK_COLLECTION }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.22.5"
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/.module-cache
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: go mod tidy
- name: Build
run: make build
- name: Test
run: make test