-
Notifications
You must be signed in to change notification settings - Fork 25
129 lines (108 loc) · 3.61 KB
/
ci.yaml
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
123
124
125
126
127
128
129
name: ReSDK CI
on:
push:
branches:
- master
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
pull_request:
workflow_dispatch:
jobs:
unittest:
runs-on: arc-runner
env:
TOX_COMMAND: "tox --skip-missing-interpreters false"
strategy:
fail-fast: false
matrix:
toxenv: [py38, py39, py310, py311, py312, docs, linters, package]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Assert PR is up-to-date
if: github.event_name == 'pull_request'
run: |
git fetch origin ${{ github.base_ref }}
git fetch origin HEAD --unshallow
git_change_target_merge_base=$(git merge-base HEAD origin/${{ github.base_ref }})
git_change_target_sha=$(git rev-parse origin/${{ github.base_ref }})
if [[ "${git_change_target_merge_base}" != "${git_change_target_sha}" ]]; then
echo 'Pull request is not up-to-date!'
echo "Please, rebase your pull request on top of '${{ github.base_ref }}' (commit: ${git_change_target_sha})."
exit 1
fi
- name: Run Tests
run: >
${{ env.TOX_COMMAND }} -e ${{ matrix.toxenv }}
e2e:
runs-on: arc-runner
needs: unittest
env:
GENESIS_POSTGRESQL_NAME: genialis-base
GENESIS_POSTGRESQL_USER: genialis-base
GENESIS_POSTGRESQL_PASSWORD: genialis-base
GENESIS_POSTGRESQL_PORT: 55434
GENESIS_REDIS_PORT: 56381
GENESIS_RESDK_PATH: ".."
GENESIS_REST_THROTTLING: '{"login": "100000/hour", "credentials": "100000/hour", "email": "100000/hour"}'
services:
postgres:
image: public.ecr.aws/docker/library/postgres:14
env:
POSTGRES_USER: genialis-base
POSTGRES_DB: genialis-base
POSTGRES_PASSWORD: genialis-base
ports:
- 55434:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: public.ecr.aws/docker/library/redis:7-alpine
ports:
- 56381:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout resolwe-bio-py
uses: actions/checkout@v4
- name: Checkout genialis-base
uses: actions/checkout@v4
with:
repository: genialis/genialis-base
path: genialis-base
ssh-key: ${{ secrets.GHA_SSH_PRIVATE_KEY_GENIALIS_DEPLOY }}
- name: Run tests
run: |
cd genialis-base
# Prepare frontend configuration
mkdir -p frontend/genjs/schema
echo '{}' > frontend/genjs/schema/configuration.json
# Make sure `python` refers to the tox environment's Python
export PATH=`pwd`/.tox/py310-e2e-resdk/bin:$PATH
tox --skip-missing-interpreters false -e py310-e2e-resdk
build:
runs-on: arc-runner
needs: [unittest, e2e]
if: startsWith(github.ref, 'refs/tags')
env:
PYTHON: "python3.12"
steps:
- uses: actions/checkout@v4
- name: Install build
run: ${{ env.PYTHON }} -m pip install --user build
- name: Build a binary wheel and a source tarball
run: ${{ env.PYTHON }} -m build --sdist --wheel --outdir dist/ .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: .coverage
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.8
with:
password: ${{ secrets.pypi_password }}