Skip to content

feat: add possibility to authenticate using access_token & anonymously #444

feat: add possibility to authenticate using access_token & anonymously

feat: add possibility to authenticate using access_token & anonymously #444

Workflow file for this run

name: Check code
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
env:
PYTHON_VERSION: '3.10'
POETRY_VERSION: '1.6.1'
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached dependencies
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction
- name: Lint with pre-commit
run: |
poetry run pre-commit run --all-files
test:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Poetry
run: |
pip install poetry==$POETRY_VERSION
poetry config virtualenvs.in-project true
poetry config virtualenvs.create true
- name: Load cached dependencies
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry env use python${{ matrix.python-version }}
poetry install --no-interaction
- name: Run pytest
run: |
# https://stackoverflow.com/a/16081218
EXIT_STATUS=0
poetry run pytest --cov=pyartifactory --cov-branch --cov-report=xml || EXIT_STATUS=$?
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml || EXIT_STATUS=$?
exit $EXIT_STATUS
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}