Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update and improve github workflows #492

Merged
merged 1 commit into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
---
name: Action Lint

# yamllint disable-line rule:truthy
on:
pull_request: {}
push:
branches:
- main

name: Action Lint
jobs:
actionlint:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v4
- name: Check workflow files
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: docs deploy


# yamllint disable-line rule:truthy
on:
push:
branches:
Expand All @@ -10,14 +11,12 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
- name: Checkout
uses: actions/checkout@v4
- run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10.4
- run: |
python -m pip install poetry
python -m pip install poetry-plugin-export
poetry export -f requirements.txt --output requirements.txt --with dev --without-hashes
python -m pip install -r requirements.txt # for some reason it is not installed by poetry
mkdocs gh-deploy --force
rm requirements.txt
cache: poetry
- run: poetry install
- run: mkdocs gh-deploy --force
34 changes: 18 additions & 16 deletions .github/workflows/main.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
cache: poetry
- name: Install dependencies
run: poetry install -E debug-toolbar
- name: Install Deps
run: poetry install
- run: echo "$(poetry env info --path)/bin" >> $"GITHUB_PATH"
- id: venv
run: echo "python-path=$(poetry env info --path)/bin/python3" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -57,30 +57,32 @@ jobs:
mode:
- std
- geos
exclude:
# Django 5.0 only supports python 3.10+
- django-version: 5.0.*
python-version: '3.8'
- django-version: 5.0.*
python-version: '3.9'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install OS Dependencies
if: ${{ matrix.mode == 'geos' }}
uses: daaku/gh-action-apt-install@v4
with:
packages: binutils gdal-bin libproj-dev libsqlite3-mod-spatialite
- name: Install Poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
cache: poetry
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/actions-poetry@v2
- name: Install & Cache Dependencies
id: cache-deps
uses: allanchain/poetry-cache-action@release
with:
upload-strategy: on-success
cache-key-prefix: python${{ matrix.python-version }}-django${{ matrix.django-version }}
- name: Install Deps
run: poetry install
- name: Install Django ${{ matrix.django-version }}
if: ${{ !steps.cache-deps.outputs.cache-hit }}
run: poetry run pip install "django==${{ matrix.django-version }}"
run: poetry run pip install "django==${{ matrix.django-version }}"
- name: Test with pytest
run: poetry run pytest --showlocals -vvv --cov-report=xml
- name: Upload coverage to Codecov
Expand Down
Loading