-
Notifications
You must be signed in to change notification settings - Fork 11
77 lines (61 loc) · 1.83 KB
/
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
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
name: Run backend and e2e tests
on:
push:
branches-ignore:
- production
pull_request:
branches-ignore:
- production
env:
MONGO_VERSION: 6.0.14
UBUNTU_VERSION: linux-x86_64-ubuntu2004
jobs:
tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Lint code
uses: golangci/golangci-lint-action@v4
with:
version: v1.57.2
args: --timeout 2m0s
- name: Vet code
run: go vet ./...
- name: Download MongoDB and setup standalone db
run: |
wget --quiet http://downloads.mongodb.org/linux/mongodb-$UBUNTU_VERSION-$MONGO_VERSION.tgz
tar xzvf mongodb-$UBUNTU_VERSION-$MONGO_VERSION.tgz
echo "$PWD/mongodb-$UBUNTU_VERSION-$MONGO_VERSION/bin" >> $GITHUB_PATH
mkdir $PWD/db
mongod --dbpath $PWD/db --logpath /dev/null --nojournal --fork
- name: Run test
run: tools/test.sh
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage.txt
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install npm test dependencies
working-directory: internal/web
run: npm install
- name: Check minified files
id: check_minified_files
working-directory: internal/web
run: |
npm run build
git diff --quiet
- name: Print message if files are out of sync
if: failure() && steps.check_minified_files.outcome == 'failure'
run: echo "minified files are out of sync, run 'npm run build' and commit the modified files"
- name: Start local instance
run: |
go build
./mongoplayground&
- name: Run e2e tests
working-directory: internal/web
run: npm run test