Adding GH Actions to gne_tests #14
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: GNE Standard Tests | |
on: [push,pull_request] | |
jobs: | |
linters: | |
name: linters | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "List files and directories" | |
run: | | |
pwd | |
ls -al . | |
ls -al .. | |
- name: Checkout 'gne_tests' repository | |
uses: actions/checkout@v4 | |
with: | |
path: gne_tests | |
- name: Checkout 'gne_exercises' repository | |
uses: actions/checkout@v4 | |
with: | |
repository: twin-bridges/gne_exercises | |
path: gne_exercises | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
id: cp311 | |
with: | |
python-version: '3.11' | |
architecture: x64 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.7.1 | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Cache Poetry virtualenv | |
uses: actions/cache@v4 | |
id: cached-poetry-dependencies | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-cache-${{ steps.cp311.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install Virtual Environment Dependencies | |
run: poetry install -C gne_tests/ | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
- name: "List files and directories" | |
run: | | |
pwd | |
ls -al . | |
ls -al .. | |
- name: View installed packages | |
run: | | |
poetry run -C gne_tests run python -m pip list | |
- name: Run pylama on 'gne_tests' and 'gne_exercises' | |
run: | | |
poetry run -C gne_tests pylama . | |
poetry run -C gne_tests pylama ../gne_exercises/ | |
- name: Run black on 'gne_tests' and 'gne_exercises' | |
run: | | |
poetry run -C gne_tests black --check . | |
poetry run -C gne_tests black --check ../gne_exercises/ | |