-
Notifications
You must be signed in to change notification settings - Fork 61
70 lines (60 loc) · 2.13 KB
/
ci.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: ci
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-20.04
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
# podman disabled due to https://github.com/containers/podman/issues/8539
engine: [docker, singularity]
steps:
- uses: actions/checkout@v2
- name: set env variables
run: |
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
echo "ENGINE=${{ matrix.engine }}" >> $GITHUB_ENV
if [[ "${{ matrix.engine }}" == "docker" ]]; then
echo "ENABLE_SLURM_RUNNER_TESTS=1" >> $GITHUB_ENV
echo "ENABLE_K8S_RUNNER_TESTS=1" >> $GITHUB_ENV
echo "ENABLE_DRONE_TRANSLATOR_TESTS=1" >> $GITHUB_ENV
echo "ENABLE_TASK_TRANSLATOR_TESTS=1" >> $GITHUB_ENV
fi
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install
run: |
src/scripts/install_kind.sh
src/scripts/install_podman.sh
src/scripts/install_singularity.sh
src/scripts/install_drone.sh
src/scripts/install_task.sh
python -m pip install --upgrade pip
pip install coverage
pip install -e src/[dev]
- name: lint
run: black --check --diff .
- name: test
run: |
# run tests
coverage run -m unittest src/test/test_*
- name: test-integration
run: |
src/test/integration/test_translator_drone.sh
src/test/integration/test_translator_task.sh
- name: package
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
# obtain version (generate src/popper/_version.py)
popper version
# run release pipeline
popper run --allow-undefined-secrets-in-ci
- name: upload coverage results
run: bash <(curl -s https://codecov.io/bash)