-
Notifications
You must be signed in to change notification settings - Fork 4
94 lines (76 loc) · 2.48 KB
/
main.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
name: CI
on:
push:
pull_request:
branches: [master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
PIPENV_VENV_IN_PROJECT: 1
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
PYMONGOIM__MONGO_VERSION: 4.4
PYMONGOIM__OPERATING_SYSTEM: ubuntu
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "pypy-3.9"]
name: Test Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
- name: Install
id: install
run: |
pip install --upgrade pip
pip install poetry
poetry install --no-root
- name: Lint
if: success() || steps.install.outcome == 'success'
run: poetry run ruff check ebl
- name: Code Style
if: success() || steps.install.outcome == 'success'
run: poetry run ruff format --check ebl
- name: Type Check
if: success() || steps.install.outcome == 'success'
run: poetry run pyre check
- name: Download
run: poetry run python -m ebl.tests.downloader
- name: Unit Tests
if: ${{ startsWith(matrix.python-version, 'pypy') }}
env:
CI: true
run: poetry run pytest
- name: Unit Tests with Coverage
uses: paambaati/[email protected]
if: ${{ !startsWith(matrix.python-version, 'pypy') }}
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: poetry run pytest --cov=ebl --cov-report term --cov-report xml
docker:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
registry: ebl.badw.de
username: ${{ secrets.EBL_REGISTRY_USERNAME }}
password: ${{ secrets.EBL_REGISTRY_PASSWORD }}
- id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: |
ebl.badw.de/ebl-api:master
${{format('ebl.badw.de/ebl-api:master.{0}', github.run_number)}}