-
Notifications
You must be signed in to change notification settings - Fork 6
70 lines (60 loc) · 1.88 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
name: KBase User Profile tests
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
# run workflow when merging to main or develop
branches:
- main
- master
- develop
jobs:
user_profile_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- java: '8'
mongo: 'mongodb-linux-x86_64-ubuntu2204-7.0.4'
- java: '11'
mongo: 'mongodb-linux-x86_64-3.6.23'
steps:
- uses: actions/checkout@v3
- name: Set up java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{matrix.java}}
- name: Install dependencies and set up test config
env:
KBASE_CI_TOKEN: ${{ secrets.KBASE_CI_TOKEN }}
KBASE_CI_TOKEN2: ${{ secrets.KBASE_CI_TOKEN2 }}
shell: bash
run: |
export HOMEDIR=`pwd`
# move to parent dir of homedir to install binaries etc
cd ..
# set up mongo
wget -q http://fastdl.mongodb.org/linux/${{matrix.mongo}}.tgz
tar xfz ${{matrix.mongo}}.tgz
export MONGOD=`pwd`/${{matrix.mongo}}/bin/mongod
# set up test config
cd $HOMEDIR
cp -n test.cfg.example test.cfg
sed -i "s#^test.mongo-exe-path.*#test.mongo-exe-path=$MONGOD#" test.cfg
sed -i "s#^test.admin-token.*#test.admin-token = $KBASE_CI_TOKEN#" test.cfg
sed -i "s#^test.usr1-token.*#test.usr1-token = $KBASE_CI_TOKEN2#" test.cfg
echo "\ntest.mongo-exe-path=$MONGOD\n" >> test.cfg
- name: Run tests
shell: bash
run: ./gradlew test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true