Run the test suite on the Forgejo runner
All checks were successful
CI / Tests (Python 3.8) (push) Successful in 1m44s
All checks were successful
CI / Tests (Python 3.8) (push) Successful in 1m44s
This commit is contained in:
parent
2a3450f537
commit
f253c09f43
2 changed files with 65 additions and 32 deletions
65
.forgejo/workflows/ci.yml
Normal file
65
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
|
||||||
|
# Run on every push and on pull requests
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
|
||||||
|
# Use `bash` instead of the container's default `sh`
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Tests (Python 3.8)
|
||||||
|
runs-on: debian-13
|
||||||
|
|
||||||
|
# Throwaway database, reachable from the job as host `postgres`
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:17
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: user
|
||||||
|
POSTGRES_PASSWORD: password
|
||||||
|
POSTGRES_DB: db
|
||||||
|
|
||||||
|
# Same variables as in `.env` on `nehemiah`, the main development machine
|
||||||
|
env:
|
||||||
|
DATABASE_URI: postgresql://user:password@postgres:5432/db
|
||||||
|
GOOGLE_MAPS_API_KEY: AIzaDummyKeyForTests # Fake key to mock the Google API
|
||||||
|
R_LIBS: /usr/lib/R/site-library
|
||||||
|
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install system packages (psycopg2 and R)
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install --no-install-recommends \
|
||||||
|
libpq-dev \
|
||||||
|
r-base-dev \
|
||||||
|
r-cran-forecast \
|
||||||
|
r-cran-zoo \
|
||||||
|
-y
|
||||||
|
|
||||||
|
- name: Install development tool chain (Python, uv, poetry)
|
||||||
|
run: |
|
||||||
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||||
|
"$HOME/.local/bin/uv" python install 3.8
|
||||||
|
"$HOME/.local/bin/uv" tool install 'poetry==1.8.5'
|
||||||
|
|
||||||
|
- name: Install the project
|
||||||
|
run: |
|
||||||
|
poetry env use "$(uv python find 3.8)"
|
||||||
|
poetry install --no-interaction
|
||||||
|
|
||||||
|
# `TESTING=true` comes from `setup.cfg`
|
||||||
|
- name: Run the test suite
|
||||||
|
run: poetry run pytest -q
|
||||||
32
.github/workflows/tests.yml
vendored
32
.github/workflows/tests.yml
vendored
|
|
@ -1,32 +0,0 @@
|
||||||
name: CI
|
|
||||||
on: push
|
|
||||||
jobs:
|
|
||||||
fast-tests:
|
|
||||||
name: fast (without R)
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-python@v1
|
|
||||||
with:
|
|
||||||
python-version: 3.8
|
|
||||||
architecture: x64
|
|
||||||
- run: pip install nox==2020.5.24
|
|
||||||
- run: pip install poetry==1.1.4
|
|
||||||
- run: nox -s format lint ci-tests-fast safety docs
|
|
||||||
slow-tests:
|
|
||||||
name: slow (with R)
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
R_LIBS: .r_libs
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-python@v1
|
|
||||||
with:
|
|
||||||
python-version: 3.8
|
|
||||||
architecture: x64
|
|
||||||
- run: mkdir .r_libs
|
|
||||||
- run: sudo apt-get install r-base r-base-dev libcurl4-openssl-dev libxml2-dev patchelf
|
|
||||||
- run: R -e "install.packages('forecast')"
|
|
||||||
- run: pip install nox==2020.5.24
|
|
||||||
- run: pip install poetry==1.1.4
|
|
||||||
- run: nox -s ci-tests-slow
|
|
||||||
Loading…
Reference in a new issue