Repository navigation
85 lines (71 loc) · 2.92 KB
/
Copy pathtests.yml
File metadata and controls
85 lines (71 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# ============================================================
# This file is part of DataLaVista™
# tests.yml: GitHub Actions workflow - runs the automated tests.
# Author(s): Gabriel Mongefranco.
# Created: 2026-10-27
# Last Modified: 2026-10-28
# Summary: Runs repository checks, the help page build, the build, and unit tests on pull requests.
# Notes: See README file for documentation and full license information.
# Website: https://github.com/DepressionCenter/datalavista
#
# Copyright © 2026 The Regents of the University of Michigan
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
# ================================================================
name: Tests
# Pull requests are tested before they merge, so pushes to main are not tested again
on:
pull_request:
workflow_dispatch:
permissions:
contents: read
# A newer push to the same branch makes the older run pointless
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Repository checks, build, and unit tests
runs-on: ubuntu-latest
timeout-minutes: 8
steps:
- name: Checkout
uses: actions/checkout@v7
with:
# The full history lets the checks compare a pull request with its target branch
fetch-depth: 0
- name: Repository checks
run: bash tests/check-repository.sh "origin/${{ github.base_ref }}"
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.12'
cache: pip
cache-dependency-path: requirements-docs.txt
- name: Install the help page builder
run: pip install -r requirements-docs.txt
# A broken link or a page missing from mkdocs.yml fails the pull request
- name: Build the help pages
run: mkdocs build --strict
- name: Test the help page link hook
run: python -m unittest tests/docs_links_test.py
- name: Cache esbuild
uses: actions/cache@v6
with:
path: ~/.cache/datalavista-build
key: esbuild-0.28.0-linux-x64
- name: Build
run: bash build.sh
# The runner already has Node.js, so nothing is installed for these steps
- name: Check the built script for syntax errors
run: node --check dist/datalavista.js
- name: Unit tests
run: node --test tests/*.test.cjs