forked from feliixx/mongoplayground
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (65 loc) · 2.1 KB
/
test.yml
File metadata and controls
82 lines (65 loc) · 2.1 KB
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
name: Run backend and e2e tests
on:
push:
branches-ignore:
- production
pull_request:
branches-ignore:
- production
env:
MONGO_VERSION: 8.0.13
UBUNTU_VERSION: linux-x86_64-ubuntu2204
jobs:
tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.25"
- name: Lint code
uses: golangci/golangci-lint-action@v8
with:
version: latest
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
mkdir $PWD/db
$PWD/mongodb-$UBUNTU_VERSION-$MONGO_VERSION/bin/mongod --dbpath $PWD/db --logpath /dev/null --fork
- name: Download mongosh
run: |
wget --quiet https://downloads.mongodb.com/compass/mongosh-2.5.1-linux-x64.tgz
tar xzvf mongosh-2.5.1-linux-x64.tgz
echo "$PWD/mongosh-2.5.1-linux-x64/bin" >> $GITHUB_PATH
- name: Run test
run: tools/test.sh
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
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