5 pipeline with unit tests #10
@@ -0,0 +1,21 @@
|
|||||||
|
# Custom CI image for the arm64 (Raspberry Pi) Gitea Actions runner.
|
||||||
|
#
|
||||||
|
# The official sagemath/sagemath image is amd64-only; conda-forge's `sage`
|
||||||
|
# package is the one place SageMath is actually published for linux-aarch64,
|
||||||
|
# so this bakes it (plus the lint/test tools) into a single image, built and
|
||||||
|
# pushed once rather than reinstalled on every CI run.
|
||||||
|
#
|
||||||
|
# Build & push (run directly on the Pi, or any arm64 machine with Docker):
|
||||||
|
# docker build -t gitea.piribauer.ch/julian/sage-ci:latest -f .gitea/ci-image/Dockerfile .
|
||||||
|
# docker login gitea.piribauer.ch -u julian
|
||||||
|
# docker push gitea.piribauer.ch/julian/sage-ci:latest
|
||||||
|
#
|
||||||
|
# Rebuild and re-push whenever this Dockerfile changes (e.g. bumping the sage
|
||||||
|
# version) or the pinned tool versions need updating.
|
||||||
|
|
||||||
|
FROM condaforge/miniforge3:latest
|
||||||
|
|
||||||
|
RUN mamba install -y -c conda-forge sage ruff pytest \
|
||||||
|
&& mamba clean -afy
|
||||||
|
|
||||||
|
WORKDIR /workspace
|
||||||
@@ -9,16 +9,16 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# Custom image (see .gitea/ci-image/Dockerfile): the official
|
||||||
|
# sagemath/sagemath image is amd64-only and this runner is arm64, and
|
||||||
|
# ruff/pytest are baked in here so jobs don't reinstall them every run.
|
||||||
container:
|
container:
|
||||||
image: sagemath/sagemath:10.4
|
image: gitea.piribauer.ch/julian/sage-ci:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install ruff
|
|
||||||
run: sage --pip install ruff
|
|
||||||
|
|
||||||
- name: Preparse .sage files
|
- name: Preparse .sage files
|
||||||
# Turns each *.sage file into real Python (*.sage.py) so ruff can
|
# Turns each *.sage file into real Python (*.sage.py) so ruff can
|
||||||
# parse it, and prepends the `from sage.all import *` that `sage`
|
# parse it, and prepends the `from sage.all import *` that `sage`
|
||||||
@@ -40,14 +40,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: lint
|
needs: lint
|
||||||
container:
|
container:
|
||||||
image: sagemath/sagemath:10.4
|
image: gitea.piribauer.ch/julian/sage-ci:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install pytest
|
|
||||||
run: sage --pip install pytest
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: sage --python -m pytest tests/
|
run: sage --python -m pytest tests/
|
||||||
|
|||||||
Reference in New Issue
Block a user