Skip to content

Commit

Permalink
Update Github Actions (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
a1d4r authored Apr 8, 2024
1 parent 80f3230 commit 3a947bd
Showing 1 changed file with 84 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: run-lint-tests
name: {{ cookiecutter.package_name }}

on:
push:
Expand All @@ -11,37 +11,87 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "{{ cookiecutter.python_version }}"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cache
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: {% raw %}venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}{% endraw %}

- name: Install dependencies if cache does not exist
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Run linters
run: make lint

- name: Run tests
run: make test
- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "{{ cookiecutter.python_version }}"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cache
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: {% raw %}venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}{% endraw %}

- name: Install dependencies if cache does not exist
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Run linters
run: make lint

test:
runs-on: ubuntu-latest
permissions: write-all
steps:

- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "{{ cookiecutter.python_version }}"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cache
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: {% raw %}venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}{% endraw %}

- name: Install dependencies if cache does not exist
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Run tests
run: make test

- name: Code Coverage Summary Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: reports/coverage.xml
badge: true
format: 'markdown'
output: 'both'

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md

- name: Add Coverage Report to Job Summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY

0 comments on commit 3a947bd

Please sign in to comment.