-
Notifications
You must be signed in to change notification settings - Fork 11
55 lines (45 loc) · 1.67 KB
/
validate-and-deploy-files.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
name: validate and deploy files
on:
push:
branches:
- master
pull_request:
branches-ignore:
- '**'
jobs:
build-and-test:
name: validate and deploy files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: make build directory
run: mkdir build_dir
- name: cmake configure
run: cmake .. -DCMAKE_BUILD_TYPE=Debug -Dtrase_BUILD_OPENGL:BOOL=FALSE
working-directory: build_dir
- name: cmake build
run: cmake --build . --parallel 2
working-directory: build_dir
- name: cmake test
run: ctest -j2 --output-on-failure
working-directory: build_dir
- name: validate svg
run: |
pip3 install --upgrade pip setuptools wheel
pip3 install html5validator
/home/runner/.local/bin/html5validator --root . --match "*.svg" --also-check-svg --ignore "exception_trase_invalid_svg"
working-directory: build_dir
- name: deploy files
run: |
git clone https://github.com/trase-cpp/generated_files.git
rm generated_files/examples/*.svg
rm generated_files/tests/*.svg
cp examples/*.svg generated_files/examples/
cp tests/*.svg generated_files/tests/
cd generated_files
git add examples/*.svg tests/*.svg
git -c user.name='github-action' -c user.email='github-action' commit -a -m "updated generated files"
git push -q https://martinjrobins:$DEPLOY_ACCESS_TOKEN@github.com/trase-cpp/generated_files master &>/dev/null
working-directory: build_dir
env:
DEPLOY_ACCESS_TOKEN: ${{ secrets.DEPLOY_ACCESS_TOKEN }}