-
Notifications
You must be signed in to change notification settings - Fork 47
89 lines (75 loc) · 2.85 KB
/
website_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
82
83
84
85
86
87
88
89
---
name: Website Tests
on:
push:
branches:
- gh-pages
pull_request:
branches:
- '**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
DEBIAN_FRONTEND: noninteractive
LANG: en_US.UTF-8
LANGUAGE: en_US:en
LC_ALL: en_US.UTF-8
PODEXEC: 'podman exec --workdir /tmp/website --env-file .env web-tests'
steps:
- name: "Checkout repo"
uses: actions/checkout@v2
- name: "Cache files"
uses: actions/cache@v2
id: website-cache
with:
path: tmp/.htmlproofer
key: htmlproofer
- name: "Check for nonbreaking space in markdowns"
run: |
if grep -P '\xa0' `find source/ -name "*.md"` ; then
echo '/!\ nonbreaking spaces have been found within the markdown (see previous log entries)'
exit 2
fi
# bundler just bump versions to the locally available ones
# which means developpers would always require bleeding edge versions not available on stable servers
# this is too simplistic and breaks deployment
# instead all changes are tested via CI on the same target OS and version than the production builder
- name: "Check for simplistic bundler requirement bump"
run: |
if grep -E "^(RUBY VERSION|BUNDLED WITH)" Gemfile.lock; then
echo '/!\ please remove "RUBY VERSION" and "BUNDLED WITH" requirements in Gemfile.lock'
exit 2
fi
- name: "Install Podman"
run: sudo apt-get install -y podman
- name: "Create the Website Build Environment container"
# Duck: DO NOT change the target OS, it needs to be in sync with the production builder
run: podman run -dt --name web-tests --volume .:/tmp/website registry.fedoraproject.org/fedora:34
- name: "Install locales data in the Website Build Environment"
run: podman exec --workdir /tmp/website web-tests dnf install -y glibc-langpack-en
- name: "Define Website Build Environment Variables"
run: |
touch .env
echo LANG=en_US.UTF-8 >>.env
echo LANGUAGE=en_US:en >>.env
echo LC_ALL=en_US.UTF-8 >>.env
echo NOKOGIRI_USE_SYSTEM_LIBRARIES=true >>.env
cat .env
- name: "Install git in the Website Build Environment"
run: $PODEXEC dnf install -y git
- name: "Initialize Website Build Environment"
run: $PODEXEC ./setup.sh
- name: "Website Build"
run: $PODEXEC bundle exec jekyll build
- name: "Website HTMLProofer Test"
run: $PODEXEC bundle exec ruby htmlproofer_test.rb
# TODO: remove when all problems are fixed
continue-on-error: true
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: site-without-markdown
path: |
_site