Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💚 Update the CI & include the testing in different OS #501

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/cache.yml

This file was deleted.

48 changes: 28 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,56 +15,64 @@ jobs:
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
name: test py${{ matrix.python-version }} on ${{ matrix.os }}

runs-on: ${{ matrix.os }}-latest

strategy:
fail-fast: false
matrix:
python-version: ["3.8","3.9", "3.10", "3.11", "3.12"]
os: [ubuntu, macos, windows]
redis-version: ["6"]

steps:
- uses: actions/checkout@v4

- name: Start Redis
uses: supercharge/redis-github-action@1.7.0
with:
redis-version: ${{ matrix.redis-version }}
redis-port: 12345

- 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
run: |
pip install -r requirements/pyproject.txt && pip install -r requirements/testing.txt

- name: Freeze Dependencies
run: pip freeze

- name: Test
run: pytest --cov=authx --cov-report=xml -xv --disable-warnings --cov-fail-under=90
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
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}-with-deps

- name: Upload coverage
uses: codecov/codecov-action@v3

# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
check:
if: always()
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,11 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache-dependency-path: pyproject.toml
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish
- name: Install build dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install build
- name: Build distribution
run: python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.8.11
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
Loading