Run yamllint and actionlint in CI #39
+53
-46
@@ -1,46 +1,53 @@
|
|||||||
# Continuous integration for the squirrel census project: runs the pytest tests
|
# Continuous integration for the squirrel census project: lints the YAML and
|
||||||
# on Python 3.13 for every push and pull request. Read by Gitea Actions (a
|
# workflow files and runs the pytest tests on Python 3.13 for every push and
|
||||||
# runner must be registered for the repository). It changes nothing outside the
|
# pull request. Read by Gitea Actions (a runner must be registered for the
|
||||||
# repository and uses no secret. Decision: MIL-001 task "Add CI workflow".
|
# repository). It changes nothing outside the repository and uses no secret.
|
||||||
# Host: Gitea Actions; uses only github.* contexts, so it also runs on GitHub.
|
# Decision: MIL-001 task "Add CI workflow".
|
||||||
|
# Host: Gitea Actions; uses only github.* contexts, so it also runs on GitHub.
|
||||||
name: Tests
|
|
||||||
|
name: Tests
|
||||||
on:
|
|
||||||
push:
|
on:
|
||||||
branches: [main]
|
push:
|
||||||
pull_request:
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
permissions:
|
|
||||||
contents: read
|
permissions:
|
||||||
|
contents: read
|
||||||
env:
|
|
||||||
PYTHON_VERSION: "3.13"
|
env:
|
||||||
PIP_VERSION: "26.2.1"
|
PYTHON_VERSION: "3.13"
|
||||||
|
PIP_VERSION: "26.2.1"
|
||||||
concurrency:
|
|
||||||
group: tests-${{ github.ref }}
|
concurrency:
|
||||||
cancel-in-progress: true
|
group: tests-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
jobs:
|
|
||||||
pytest:
|
jobs:
|
||||||
name: Run the tests
|
pytest:
|
||||||
runs-on: ubuntu-latest
|
name: Run the tests
|
||||||
timeout-minutes: 10
|
runs-on: ubuntu-latest
|
||||||
steps:
|
timeout-minutes: 10
|
||||||
- name: Check out the code
|
steps:
|
||||||
uses: actions/checkout@v4.2.2
|
- name: Check out the code
|
||||||
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5.6.0
|
- name: Set up Python
|
||||||
with:
|
uses: actions/setup-python@v5.6.0
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
- name: Create the virtual environment and install
|
|
||||||
run: |
|
- name: Create the virtual environment and install
|
||||||
python -m venv .venv
|
run: |
|
||||||
.venv/bin/python -m pip install --upgrade "pip==${PIP_VERSION}"
|
python -m venv .venv
|
||||||
.venv/bin/python -m pip install -e ".[dev]"
|
.venv/bin/python -m pip install --upgrade "pip==${PIP_VERSION}"
|
||||||
|
.venv/bin/python -m pip install -e ".[dev]"
|
||||||
- name: Run the tests
|
|
||||||
run: .venv/bin/python -m pytest
|
- name: Lint the YAML files
|
||||||
|
run: .venv/bin/python -m yamllint -c .yamllint.yml .gitea .yamllint.yml
|
||||||
|
|
||||||
|
- name: Lint the workflow files
|
||||||
|
run: .venv/bin/actionlint .gitea/workflows/*.yml
|
||||||
|
|
||||||
|
- name: Run the tests
|
||||||
|
run: .venv/bin/python -m pytest
|
||||||
|
|||||||
+3
-3
@@ -6,6 +6,6 @@ rules:
|
|||||||
max: 100
|
max: 100
|
||||||
truthy:
|
truthy:
|
||||||
check-keys: false
|
check-keys: false
|
||||||
# Git on Windows checks files out with CRLF; the repository blob has LF.
|
# Line endings are normalised by git (LF in the repository, CRLF in some
|
||||||
new-lines:
|
# Windows checkouts), so the rule would fail on a local checkout only.
|
||||||
type: platform
|
new-lines: disable
|
||||||
|
|||||||
@@ -90,7 +90,8 @@ it is present.
|
|||||||
|
|
||||||
The workflow [`.gitea/workflows/ci.yml`][ci] runs for every push to `main` and for every
|
The workflow [`.gitea/workflows/ci.yml`][ci] runs for every push to `main` and for every
|
||||||
pull request. It sets up Python 3.13, creates a `.venv`, upgrades `pip`, installs the
|
pull request. It sets up Python 3.13, creates a `.venv`, upgrades `pip`, installs the
|
||||||
project with `.[dev]` and runs `python -m pytest`. It uses `github.*` contexts only, so
|
project with `.[dev]`, lints the YAML and workflow files with `yamllint` and
|
||||||
|
`actionlint`, and runs `python -m pytest`. It uses `github.*` contexts only, so
|
||||||
it also runs on GitHub Actions.
|
it also runs on GitHub Actions.
|
||||||
|
|
||||||
## Build the source documentation
|
## Build the source documentation
|
||||||
|
|||||||
Reference in New Issue
Block a user