-
Notifications
You must be signed in to change notification settings - Fork 15
155 lines (148 loc) · 4.9 KB
/
tests.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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:
- "/^v\\d+\\.\\d+\\.\\d+(-(alpha|beta|rc)(\\.\\d+)?)?$/"
schedule:
- cron: "0 0 * * 6"
jobs:
unit-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.9, '3.10', '3.11']
core-commands-as-plugins: [false]
exclude:
- os: macos-latest
python-version: 3.10
- os: macos-latest
python-version: 3.11
include:
- os: ubuntu-latest
python-version: 3.9
core-commands-as-plugins: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Git
run: |
git config --global user.name "Repo Bee"
git config --global user.email repoobee@repobee.org
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install \
-r requirements/requirements.txt \
-r requirements/requirements.dev.txt
pip install -e .[DEV]
- name: Test with pytest
env:
REPOBEE_CORE_COMMANDS_AS_PLUGINS: ${{ matrix.core-commands-as-plugins }}
run: |
echo "REPOBEE_CORE_COMMANDS_AS_PLUGINS: $REPOBEE_CORE_COMMANDS_AS_PLUGINS"
coverage run --branch \
--source _repobee,repobee_plug,repobee_testhelpers \
-m pytest tests/unit_tests tests/integration_tests
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
file: ./coverage.xml
gitlab-system-tests:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'create'
|| github.event_name == 'schedule'
|| (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'gitlab')) }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Set up Git
run: |
git config --global user.name "Repo Bee"
git config --global user.email repoobee@repobee.org
git config --global http.sslverify false
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install \
-r requirements/requirements.txt \
-r requirements/requirements.dev.txt
pip install -e .[DEV]
- name: Run system tests
env:
REPOBEE_NO_VERIFY_SSL: true
PYTHONWARNINGS: "ignore:Unverified HTTPS request"
run: |
coverage run --branch \
--source _repobee,repobee_plug,repobee_testhelpers \
-m pytest system_tests/gitlab/test_gitlab_system.py -vv --showlocals
coverage xml
- name: Clean up volume data
run: |
sudo rm -rf system_tests/gitlab/volume_data
git restore system_tests/gitlab/volume_data
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
file: ./coverage.xml
gitea-system-tests:
runs-on: ubuntu-latest
strategy:
matrix:
core-commands-as-plugins: [false, true]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Set up Git
run: |
git config --global user.name "Repo Bee"
git config --global user.email repoobee@repobee.org
- name: Install RepoBee
run: |
python -m pip install --upgrade pip
pip install \
-r requirements/requirements.txt \
-r requirements/requirements.dev.txt
pip install -e .[DEV]
- name: Run Gitea system tests
env:
REPOBEE_NO_VERIFY_SSL: true
PYTHONWARNINGS: "ignore:Unverified HTTPS request"
REPOBEE_CORE_COMMANDS_AS_PLUGINS: ${{ matrix.core-commands-as-plugins }}
run: |
echo "REPOBEE_CORE_COMMANDS_AS_PLUGINS: $REPOBEE_CORE_COMMANDS_AS_PLUGINS"
git config --global http.sslverify false
python system_tests/gitea/giteamanager.py prime
coverage run --branch \
--source _repobee,repobee_plug,repobee_testhelpers \
-m pytest -vv --showlocals system_tests/gitea
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
file: ./coverage.xml