Adding two features on EDS-TEVA #224
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: Tests and Linting | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
check_skip: | |
name: Check CI Skip | |
runs-on: ubuntu-latest | |
outputs: | |
skip: ${{ steps.result_step.outputs.ci-skip }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- id: result_step | |
uses: mstachniuk/ci-skip@master | |
with: | |
commit-filter: '[skip ci];[ci skip];[skip github]' | |
commit-filter-separator: ';' | |
linting: | |
name: Running pre-commit | |
needs: check_skip | |
if: ${{ needs.check_skip.outputs.skip == 'false' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@master | |
- name: Set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.7' | |
- name: Set PY variable | |
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Install pre-commit | |
run: | | |
pip install pre-commit | |
pre-commit install | |
- name: Run pre-commit | |
run: SKIP=no-commit-to-branch pre-commit run --all-files | |
testing: | |
name: Testing with PyTest | |
needs: check_skip | |
if: ${{ needs.check_skip.outputs.skip == 'false' }} | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@master | |
- name: Set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.7' | |
- name: Load cached Poetry installation | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local # the path depends on the OS | |
key: poetry-0 # increment to reset cache | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.3.2 | |
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 config experimental.new-installer false | |
poetry install | |
- name: Set up Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: Test with Pytest | |
run: poetry run pytest tests --cov edsteva --cov-report xml | |
- name: Upload coverage | |
uses: codecov/codecov-action@v2 | |
- name: Check dependencies licenses | |
run: poetry run pylic check | |
documentation: | |
name: Building Documentation | |
needs: check_skip | |
if: ${{ needs.check_skip.outputs.skip == 'false' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@master | |
- name: Set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.7' | |
- name: Load cached Poetry installation | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local # the path depends on the OS | |
key: poetry-0 # increment to reset cache | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.3.2 | |
virtualenvs-in-project: true | |
- name: Install dependencies | |
run: poetry install --only docs | |
- name: Build documentation | |
run: poetry run mkdocs build --clean |