-
-
Notifications
You must be signed in to change notification settings - Fork 152
106 lines (101 loc) · 2.8 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
name: "CI"
on: [push, pull_request]
permissions:
contents: read
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [ 18, 20 ]
name: Test(Node ${{ matrix.node }} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install
run: npm ci
- name: Test
run: npm test
- name: Test Examples
run: npm run test:examples
benchmark:
name: Benchmark
runs-on: ubuntu-latest
permissions:
contents: write
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- name: Install Hyperfine
run: |
wget https://github.com/sharkdp/hyperfine/releases/download/v1.15.0/hyperfine_1.15.0_amd64.deb
sudo dpkg -i hyperfine_1.15.0_amd64.deb
- name: Install
run: npm ci
- name: Build textlint
run: npm run build
- name: Benchmark
run: npm run bench
working-directory: ./test/benchmark
- name: Get Previous Benchmark Results
uses: actions/cache@v3
with:
path: ./cache
key: ${{ runner.os }}-benchmark
- name: Save Benchmark Results
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'customSmallerIsBetter'
output-file-path: ./test/benchmark/output.json
benchmark-data-dir-path: 'benchmarks'
fail-on-alert: true
comment-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
- name: Output Step Summary
run: |
cat ./test/benchmark/result.md > $GITHUB_STEP_SUMMARY
echo "- <https://textlint.github.io/textlint/benchmarks/>" >> $GITHUB_STEP_SUMMARY
e2e:
name: E2E
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- name: Install
run: npm ci
- name: Build textlint
run: npm run build
- name: Integration Tests
run: npm run test:integration
documentation:
strategy:
matrix:
node: [ 18 ]
name: Documentation(Node ${{ matrix.node }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install
run: npm ci
- run: npm run test:docs
- run: npm run website