-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (45 loc) · 1.21 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
name: Test
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: pip installs
run: pip install -U pytest requests
- name: Make temp directory
run: mkdir /tmp/o2r
# Setup docker containers for testing
- name: Set up MongoDB
run: docker run --name mongodb -d -p 27017:27017 mongo:3.4
- name: Build shipper
run: docker build --tag shipper .
- name: Set up testshipper
run: >-
docker run
--name testshipper -t -d
-p 8087:8087
--link mongodb:mongodb
-v /tmp/o2r:/tmp/o2r
-e SHIPPER_REPO_TOKENS='{"download": "none"}'
-e SHIPPER_BOTTLE_HOST=0.0.0.0
-e SHIPPER_MONGODB=mongodb://mongodb:27017/
shipper
- name: Run pytest
run: |
sleep 10
pytest
- name: Logs in case of failure
if: ${{ failure() }}
run: |
docker logs testshipper