⬆ Bump actions/checkout from 3 to 4 (#491) #130
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
pull_request: {} | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: pip install -r requirements/pyproject.txt && pip install -r requirements/linting.txt | |
- uses: pre-commit/action@v3.0.0 | |
with: | |
extra_args: --all-files --verbose | |
test: | |
name: test on python ${{ matrix.python-version }} | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8","3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v3 | |
id: cache | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test | |
- name: Install Dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: pip install -r requirements/all.txt | |
- name: Test | |
env: | |
ENV: test | |
REDIS_URL: "redis://0.0.0.0:6379" | |
run: pytest --cov=authx --cov-report=html -xv --color=yes --disable-warnings --cov-fail-under=80 | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks | |
check: | |
if: always() | |
needs: [lint, test] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} |