-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (95 loc) · 3.06 KB
/
main.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Copyright 2022-2024 the Lactoserv Authors (Dan Bornstein et alia).
# SPDX-License-Identifier: Apache-2.0
name: Lint / Build / Test
# Controls when the workflow will run.
on:
# Triggers the workflow on push or PR events for the branch `main`.
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
# Workflow. Jobs run in parallel by default, but that is moot here: there's only
# one job.
jobs:
# Check dependencies.
check-dependencies:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Clone repo.
uses: actions/checkout@v4
- name: Check dependencies.
uses: actions/dependency-review-action@v4
with:
warn-only: true
# Use these if you want to run a "from-scratch" check.
# base-ref: 260014145f
# head-ref: HEAD
fail-on-scopes: runtime, unknown
show-openssf-scorecard: false
warn-on-openssf-scorecard-level: 2
allow-licenses: |
0BSD,
Apache-2.0,
BSD-2-Clause,
BSD-3-Clause,
BSD-3-Clause-Clear,
CC0-1.0,
CC-BY-3.0,
CC-BY-4.0,
ISC,
MIT,
Python-2.0,
Unlicense
# Build the project.
build:
runs-on: ubuntu-latest
steps:
- name: Get Node.
uses: actions/setup-node@v4
with:
node-version: '20.x'
# Note: Checks out into `$GITHUB_WORKSPACE`, which is also the `$CWD`.
- name: Clone repo.
uses: actions/checkout@v4
- name: Run the linter.
run: ./scripts/ubik dev lint
- name: Actually build.
run: ./scripts/ubik dev build distro
- name: Run the unit tests.
run: ./scripts/ubik run-tests
- name: Run the integration tests.
run: ./scripts/ubik run-tests --type=integration
- name: Run the unit tests, with coverage reporting.
run: |
./scripts/ubik run-tests --type=unit-coverage || {
echo 'Weird coverage-report failure (originally started happening'
echo '2024-05-17).'
}
- name: Ensure the cert creator still works.
run: ./scripts/ubik make-localhost-cert
- name: Tarball artifact.
uses: actions/upload-artifact@v4
with:
name: distro
path: out/lactoserv-*.tgz
if-no-files-found: error
overwrite: true
retention-days: 90
- name: node_modules artifact.
uses: actions/upload-artifact@v4
with:
name: node_modules
path: |
out/lactoserv/lib/node_modules
out/lactoserv/lib/package*.json
if-no-files-found: error
overwrite: true
retention-days: 90
- name: Announcement.
run: |
info="$(jq . out/lactoserv/product-info.json)"
printf '::notice title=product-info::%s\n' \
"$(awk <<<"${info}" '{ printf("%s%%0A", $0); }')"