-
Notifications
You must be signed in to change notification settings - Fork 3
98 lines (94 loc) · 2.78 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
name: CI
on:
push:
branches:
- master
jobs:
test:
name: Test
uses: ./.github/workflows/test.yml
secrets: inherit
build:
needs:
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node and Dependencies
uses: ./.github/actions/setup
- name: Build
run: yarn build
- name: Cache build output
uses: actions/cache@v3
with:
path: ./dist
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}
integration_test:
needs: [build]
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
version: [14, 16, 18]
runs-on: ${{ matrix.os }}
name: Test action with Node v${{ matrix.version }} and ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Restore build cache
id: build-restore
uses: actions/cache@v3
with:
path: ./dist
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}
- name: Ensure cache is restored
if: steps.build-restore.outputs.cache-hit != 'true'
run: exit 1
- name: Run local action with latest tags
uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
use-linkcheck: true
use-mermaid: true
use-toc: true
use-opengh: true
use-admonish: true
use-katex: true
- name: Test mdBook binary
run: mdbook --version
- name: Test mdbook-linkcheck binary
run: mdbook-linkcheck --version
- name: Test mdbook-mermaid binary
run: mdbook-mermaid --version
- name: Test mdbook-toc binary
run: mdbook-toc --version
- name: Test mdbook-open-on-gh binary
run: mdbook-open-on-gh --version
- name: Test mdbook-admonish binary
run: mdbook-admonish --version
- name: Test mdbook-katex binary
run: mdbook-katex --version
release:
needs: [integration_test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore build cache
id: build-restore
uses: actions/cache@v3
with:
path: ./dist
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}
- name: Ensure cache is restored
if: steps.build-restore.outputs.cache-hit != 'true'
run: exit 1
- name: Add Change and commit
uses: EndBug/[email protected]
with:
add: "./dist --force"
default_author: github_actions
message: "chore: Generate dist files [skip ci]"
- name: Setup Node and Dependencies
uses: ./.github/actions/setup
- name: Run Semantic Release
run: yarn semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}