-
Notifications
You must be signed in to change notification settings - Fork 13
119 lines (101 loc) · 3.23 KB
/
Copy pathci.yml
File metadata and controls
119 lines (101 loc) · 3.23 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
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
112
113
114
115
116
117
118
119
name: Sanity checks and docs publishing
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 3
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node: [23, 22, 20, 18]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
examples:
runs-on: ${{ matrix.os }}
timeout-minutes: 3
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [23, 22, 20, 18]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Global install
run: npm install -g .
- name: Run examples
shell: bash
run: |
cd example
rv . counter test
rv . counter invariant
rv . cargo test
rv . cargo invariant
rv . reverse test
rv . slice test
rv . self-listing-helper-v3a test
rv . self-listing-helper-v3a invariant
rv . rendezvous-token invariant --dial=./sip010.js
publish-docs:
needs: [tests, examples]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: 'latest'
- name: Build docs
run: |
mdbook build docs
- name: Configure Git
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
- name: Deploy to GitHub Pages
run: |
# The gh-pages branch has no meaningful history since it's completely
# regenerated from scratch on each commit to master. History would be
# noise, not signal. The source of truth is the master branch and the
# build system, making the gh-pages content purely ephemeral output.
# Force pushing an orphan branch gives us exactly what we need: clean
# snapshot of the documentation at each point in time without all the
# baggage of incorrect or outdated history.
# Create orphan branch (no history).
git checkout --orphan gh-pages
# Remove all files from the working tree.
git rm -rf .
# Copy the built site to the root.
cp -r docs/dist/* .
# Add all files.
git add .
# Commit with empty message (since no history on gh-pages anyways).
git commit --allow-empty-message -m ''
# Force push to gh-pages branch (again since no history).
git push origin gh-pages --force