-
Notifications
You must be signed in to change notification settings - Fork 216
92 lines (80 loc) · 2.75 KB
/
make-and-test.yml
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
86
87
88
89
90
91
92
name: Make all packages and run their tests
# newer commits in the same PR abort running ones for the same workflow
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
env:
PGDATABASE: smc
PGUSER: smc
PGHOST: localhost
jobs:
doclinks:
runs-on: ubuntu-latest
# install python3, package requests, and run the script ./src/scripts/check_doc_links.py
steps:
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
with:
detached: true
- uses: actions/checkout@v4
- name: Install python3 requests
run: sudo apt-get install python3-requests
- name: Check doc links
run: cd src/scripts && python3 check_doc_urls.py || sleep 5 || python3 check_doc_urls.py
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_DB: smc
POSTGRES_USER: smc
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version:
- "18.17.1"
steps:
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
with:
detached: true
- uses: actions/checkout@v4
- name: Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
# https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data
# caching, etc., doesn't work without using "uses: pnpm/action-setup@v2", and that
# doesn't work, since it makes assumptions about the layout of the repo (e.g., where package.json is),
# which aren't true.
# cache: "pnpm"
# cache-dependency-path: "src/packages/pnpm-lock.yaml"
- run: cd src && npm install -g pnpm
- run: cd src && pnpm run make
- run: cd src && pnpm run test