This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (74 loc) · 2.27 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Upload data to integrations
on:
push:
pull_request:
types:
- reopened
env:
CLOUDAMQP_URL: "amqp://virtualjudge:virtualjudge@localhost:5672//"
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_USER: virtualjudge
POSTGRES_PASSWORD: virtualjudge
POSTGRES_DB: virtualjudge
jobs:
upload:
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq:3.12.9-alpine
env:
RABBITMQ_DEFAULT_USER: virtualjudge
RABBITMQ_DEFAULT_PASS: virtualjudge
ports:
- 5672:5672
postgresql:
image: postgres:16.0-alpine
ports:
- 5432:5432
env:
POSTGRES_USER: virtualjudge
POSTGRES_PASSWORD: virtualjudge
POSTGRES_DB: virtualjudge
strategy:
max-parallel: 4
matrix:
python-version: ["3.11"]
poetry-version: ["1.6.1"]
env:
DATABASE_URL: "postgres://virtualjudge:virtualjudge@localhost:5432/virtualjudge"
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry ${{ matrix.poetry-version }}
uses: snok/install-poetry@v1
with:
version: ${{ matrix.poetry-version }}
virtualenvs-create: false
installer-parallel: true
- name: Install dependencies
run: |
poetry run pip install --no-deps --upgrade pip
poetry install --with dev
- name: Generate configuration file
run: ./bin/create-env
- name: Generate tests coverage report
run: |
poetry run coverage run \
--source="." manage.py test \
--settings=server.settings.development
poetry run coverage xml
- name: Upload tests coverage report (Codecov)
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
- name: Upload tests coverage report (Code Climate)
uses: paambaati/[email protected]
with:
coverageCommand: coverage report