-
Notifications
You must be signed in to change notification settings - Fork 124
111 lines (106 loc) · 3.18 KB
/
ci.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
name: CI
on:
push:
branches:
- master
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Graphviz
uses: tlylt/install-graphviz@v1
- name: Install Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- if: matrix.platform == 'macos-latest'
run: brew install python-setuptools
- run: npm run setup
- run: npm run test
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
check-docs:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Graphviz
uses: tlylt/install-graphviz@v1
- name: Install Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- run: npm run setup
- run: npm run build:web
- name: Build MarkBind docs (UG + DG)
run: npm run build:docs
- name: Check build log
run: |
log_file="docs/_markbind/logs/markbind-$(date +'%Y-%m-%d').log"
pattern="^[0-9T:.Z-]+ - (warn|error):"
if grep -q -E "$pattern" "$log_file"; then
printf "The following issues were found when building the documentation:\n"
grep -E "$pattern" "$log_file"
exit 1
fi
deploy-docs:
needs: test
# disabled on forks
if: github.event_name == 'push' && github.repository == 'MarkBind/markbind'
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Graphviz
uses: tlylt/install-graphviz@v1
- name: Install Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- run: npm run setup
- name: Deploy DG on any commit to master, to markbind.org/devdocs
run: >-
npm run build:web &&
npm run deploy:dg
- name: Deploy UG on release, to markbind.org
if: github.ref_type == 'tag'
run: npm run deploy:ug
- name: Check deploy log
run: |
log_file="docs/_markbind/logs/markbind-$(date +'%Y-%m-%d').log"
pattern="^[0-9T:.Z-]+ - error:"
if grep -q -E "$pattern" "$log_file"; then
printf "The following issues were found when deploying the documentation:\n"
grep -E "$pattern" "$log_file"
exit 1
fi