-
Notifications
You must be signed in to change notification settings - Fork 39
91 lines (87 loc) · 3.11 KB
/
cicd.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
name: CI/CD
on:
push:
pull_request:
workflow_dispatch:
schedule: [{cron: '1 0 * * 6'}]
env:
DOCKER_BUILDKIT: "1"
COMPOSE_DOCKER_CLI_BUILD: "1"
BUILDKIT_PROGRESS: "plain"
RELEASABLE_REPOS: "^kiorky/"
RELEASABLE_BRANCHES: "^(refs/heads/)?(master|main|new-packaging)$"
jobs:
test-py2:
runs-on: ubuntu-latest
strategy: {fail-fast: false}
steps:
- uses: actions/checkout@v4
- name: Cache tox environments
uses: actions/cache@v4
with:
path: .cache
key: ${{ runner.os }}-py27
- name: install dependencies && test on py27
run: |
set -ex
export PIP_CACHE_DIR=$(pwd)/.cache/pip;export PIP_DOWNLOAD_CACHE=$PIP_CACHE_DIR
mkdir -pv $PIP_CACHE_DIR || true
sudo apt update && sudo apt install -y python2.7
mkdir venv2 && curl -sSL "https://github.com/pypa/get-virtualenv/blob/20.27.0/public/2.7/virtualenv.pyz?raw=true" > venv2/venv && python2.7 venv2/venv venv2
# we need the latest py2 compatible pytest which is not the latest available
venv2/bin/python2 -m pip install pytest -r <(grep -v pytest ./requirements/base.txt)
venv2/bin/pytest src
test-code-QA:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v4
- name: Cache tox environments
uses: actions/cache@v4
with:
path: .tox
key: ${{ runner.os }}-${{ matrix.python }}-toxQA
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with: {python-version: "${{ matrix.python-version }}", cache: pip, cache-dependency-path: 'requirements/*.txt'}
- name: install tests dependencies
run: pip install -r requirements/test.txt -r requirements/lint.txt -r requirements/tox.txt -r requirements/format.txt
- name: formatters check
run: tox --current-env -e lint,fmt
test-py3:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Cache tox environments
uses: actions/cache@v4
with:
path: .tox
key: ${{ runner.os }}-${{ matrix.python }}-tox
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with: {python-version: "${{ matrix.python-version }}", cache: pip, cache-dependency-path: 'requirements/*.txt'}
- name: install tests dependencies
run: pip install -r requirements/test.txt -r requirements/tox.txt
- name: run tests with coverage
run: tox --current-env -e cov
test-32bits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache tox environments
uses: actions/cache@v4
with:
path: .dockertox
key: ${{ runner.os }}-${{ matrix.python }}-dockertox
- name: Test with pytest
run: |
docker compose build --build-arg BASE=corpusops/croniter:32bits
docker compose run --rm app tox --current-env -e test
env: {COMPOSE_FILE: "docker-compose.yml:docker-compose-32bits.yml"}