Merge pull request #652 from gitlabform/dependabot/pip/python-gitlab-… #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linter and tests | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
black-formatting: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Black Code Formatter | |
uses: gdubicki/black-action@main | |
with: | |
args: ". --check" | |
types: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: Install test dependencies | |
run: | | |
pip install wheel | |
pip install -e .[test] | |
- name: Run mypy | |
run: | | |
mypy . || true | |
mypy --install-types --non-interactive | |
mypy . | |
acceptance-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python-version: [3.8, 3.9, "3.10", 3.11, 3.12] | |
fail-fast : false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install test dependencies | |
run: | | |
pip install wheel | |
pip install -e .[test] | |
- name: Run acceptance tests | |
run: | | |
./dev/run_gitlab_in_docker.sh | |
pytest --cov=. --cov-report=xml --durations=0 --reruns 3 --reruns-delay 10 tests/acceptance/standard | |
- name: Upload coverage to Codecov | |
uses: Wandalen/wretry.action@v1 | |
with: | |
action: codecov/codecov-action@v3 | |
with: | | |
fail_ci_if_error: true | |
token: 3e6d6cb5-fcdb-41ea-b134-f6c5856363e9 | |
attempt_limit: 5 | |
attempt_delay: 10000 | |
acceptance-tests-premium: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python-version: [3.12] | |
fail-fast : false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install test dependencies | |
run: | | |
pip install wheel | |
pip install -e .[test] | |
- name: Run acceptance tests that require premium license | |
env: | |
GITLAB_EE_LICENSE: ${{ secrets.GITLAB_EE_LICENSE }} | |
run: | | |
./dev/run_gitlab_in_docker.sh | |
pytest --cov=. --cov-report=xml --durations=0 --reruns 3 --reruns-delay 10 tests/acceptance/premium | |
- name: Upload coverage to Codecov | |
uses: Wandalen/wretry.action@v1 | |
with: | |
action: codecov/codecov-action@v3 | |
with: | | |
fail_ci_if_error: true | |
token: 3e6d6cb5-fcdb-41ea-b134-f6c5856363e9 | |
attempt_limit: 5 | |
attempt_delay: 10000 | |
unit-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python-version: [3.8, 3.9, "3.10", 3.11, 3.12] | |
fail-fast : false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install test dependencies | |
run: | | |
pip install wheel | |
pip install -e .[test] | |
- name: Run unit tests | |
run: | | |
pytest --cov=. --cov-report=xml tests/unit | |
- name: Upload coverage to Codecov | |
uses: Wandalen/wretry.action@v1 | |
with: | |
action: codecov/codecov-action@v3 | |
with: | | |
fail_ci_if_error: true | |
token: 3e6d6cb5-fcdb-41ea-b134-f6c5856363e9 | |
attempt_limit: 5 | |
attempt_delay: 10000 | |
security-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: | | |
pip install wheel | |
pip install bandit | |
- name: Run bandit | |
run: | | |
bandit -r gitlabform | |
smoke-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python-version: [3.8, 3.9, "3.10", 3.11, 3.12] | |
fail-fast : false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install runtime dependencies | |
run: | | |
pip install wheel | |
pip install -e . | |
- name: Check if the app starts | |
run: | | |
gitlabform -V |