-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (93 loc) · 2.93 KB
/
workflows.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Start MongoDB and Jaeger
run: |
docker run --rm -p 27017:27017 --name mongo -d mongo:6
docker run --rm -p 9411:9411 -p 16686:16686 --name jaeger --env QUERY_BASE_PATH=/jaeger --env COLLECTOR_ZIPKIN_HOST_PORT=9411 --name jaeger -d jaegertracing/all-in-one:1.43
- name: Install ipsportal and testing requirements
run: python -m pip install -e .[dev]
- name: Lint with flake8
run: flake8
- name: Check types
run: mypy ipsportal
- name: Run tests
run: coverage run -m pytest
- name: coverage report
run: coverage report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
- name: Stop MongoDB and Jaeger
run: |
docker stop mongo
docker stop jaeger
systemtests:
runs-on: ubuntu-latest
needs: test
strategy:
fail-fast: false
matrix:
ips-version: ["0.3.0", "0.4.1", "0.5.0", "0.6.0", "0.7.1", "0.8.0"]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install IPS
run: python -m pip install ipsframework==${{ matrix.ips-version }}
- name: Set up Docker Compose
uses: KengoTODA/actions-setup-docker-compose@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Start IPS-portal with docker-compose
run: docker-compose up -f docker-compose-complete.yml --build -d
- name: Run test
run: |
cd tests
./run_ips_test.sh
docker:
runs-on: ubuntu-latest
needs: [test, systemtests]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Log into registry ghcr.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push IPS portal
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/build-push-action@v2
with:
context: .
tags: ghcr.io/hpc-simtools/ips-portal/ipsportal:dev
push: true
- name: Build and push IPS portal version
if: startsWith(github.ref, 'refs/tags')
uses: docker/build-push-action@v2
with:
context: .
tags: |
ghcr.io/hpc-simtools/ips-portal/ipsportal:latest
ghcr.io/hpc-simtools/ips-portal/ipsportal:${{ github.ref_name }}
push: true
- name: Build and push mongodb-backup
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile.mongodb-backup
tags: ghcr.io/hpc-simtools/ips-portal/mongodb-backup:latest
push: true