-
Notifications
You must be signed in to change notification settings - Fork 5
40 lines (35 loc) · 1.11 KB
/
ci-test.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
name: Test
on:
push:
branches:
- master
paths-ignore:
- "README.md"
pull_request:
paths-ignore:
- "README.md"
jobs:
test-hugo:
runs-on: ubuntu-latest
strategy:
matrix:
hugo:
- '0.93.0' # min version
- 'latest'
fail-fast: true
steps:
- uses: actions/checkout@v3
# https://github.com/peaceiris/actions-hugo (community action)
- name: Run Hugo ${{ matrix.hugo }}
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ matrix.hugo }}
extended: true
- name: Build with Hugo ${{ matrix.hugo }}
working-directory: exampleSite
run: |
function ver { printf "%03d%03d%03d" $(echo "$1" | tr '.' ' '); }
HUGO_VERSION=$(hugo version | grep -Eo '[0-9]+\.[0-9]+((\.[0-9]+)?)')
# The option changed in 0.93.0: https://github.com/gohugoio/hugo/releases/tag/v0.93.0
I18N_OPT=$([ $(ver $HUGO_VERSION) -lt $(ver 0.93.0) ] && echo "--i18n-warnings" || echo "--printI18nWarnings")
HUGO_THEME="browse" hugo --themesDir ../.. $I18N_OPT -v