Merge pull request #32 from pwnfan/dev #73
Workflow file for this run
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: test | |
on: [push, pull_request] | |
jobs: | |
linting: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Load Pip Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip | |
restore-keys: ${{ runner.os }}-pip | |
- name: Install and Run Linters | |
run: | | |
python -m pip install black flake8 isort | |
flake8 --ignore=E203,E501,W503 . | |
black . --check | |
isort --profile black . | |
test: | |
needs: linting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Load Cached Venv | |
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 install --no-interaction | |
- name: Run Test Suite | |
run: | | |
source .venv/bin/activate | |
echo 'GITHUB_TOKEN=${{ github.token }}' >> .env | |
poetry run pytest -v --cov=tagmark --cov-report=xml tests | |
- name: Upload Coverage Reports To Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
files: ./coverage.xml | |
- name: Upload Coverage Reports To Codacy | |
uses: codacy/codacy-coverage-reporter-action@v1 | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: ./coverage.xml | |
- name: Test Run tagmark From Source Code | |
run: | | |
poetry run tagmark_cli --help | |
poetry run tagmark_cli convert --help | |
- name: Build tagmark Dist | |
run: | | |
poetry build | |
ls ${{ github.workspace }}/dist | |
- name: Create Test Venv for tagmark Dist | |
run: | | |
pip install virtualenv | |
virtualenv testvenv | |
- name: Test tagmark Dist | |
working-directory: ${{ github.workspace }}/dist | |
run: | | |
source ${{ github.workspace }}/testvenv/bin/activate | |
pip install --find-links=${{ github.workspace }}/dist tagmark | |
tagmark_cli --help | |
tagmark_cli convert --help |