-
Notifications
You must be signed in to change notification settings - Fork 1k
81 lines (65 loc) · 2.08 KB
/
tests.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
name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Lint markdown pages
run: yarn --cwd=ci && node ci/tests-fiches.mjs
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.4
bundler-cache: true
- name: Lint Ruby with Rubocop
run: bundle exec rubocop
- name: Install npm dependencies
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
- name: Check Javascript/JSON linting
run: npm run lint
- name: Unit tests
run: bundle exec rspec
# - name: Check data structure
# run: make validate
- name: "Check authors file name structure (first_name.last_name.md)"
run: |
if ls content/_authors | grep --line-regexp --invert-match '[a-z_.-]\+\.[a-z_.-]\+\.md'
then cat <<EOF
One or more authors do not have the expected structure.
Contact a website administrator if your generated author file breaks the validator.
Notes:
A dot (.) can only appear as a separator between the first and the last names.
Dashes in names are kept as-is.
Spaces are replaced by underscores (_).
File extension must be '.md'
EOF
exit 1
fi
- name: Check Jekyll configuration
run: bundle exec jekyll doctor
- name: Jekyll build
run: bundle exec jekyll build --trace
- name: Check HTML common mistakes
run: make html-proofer
- name: HTML5 Validator
uses: Cyb3r-Jak3/html5validator-action@master
with:
root: _site
skip_git_check: true
- name: Lint JSON API pages
run: bundle exec jsonlint _site/api/v*/*.json
- name: Wait for server to start
run: |
(bundle exec jekyll serve --no-watch --skip-initial-build)&
while ! curl --silent http://localhost:4000
do sleep 1
done