-
Notifications
You must be signed in to change notification settings - Fork 26
148 lines (123 loc) · 4.69 KB
/
Build.yaml
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
on:
push:
paths: [code/**, .github/workflows/Build.yaml]
pull_request:
branches: main
paths: [code/**, .github/workflows/Build.yaml]
workflow_dispatch:
name: Build
defaults:
run:
shell: bash
working-directory: code
env:
is_deployment: ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
jobs:
auto-cancel:
if: |
github.event_name == 'pull_request'
|| github.event_name == 'workflow_dispatch'
|| (github.event_name == 'push' && (github.ref == 'refs/heads/main' || contains(github.event.head_commit.message, '[workflow-trigger]')))
runs-on: ubuntu-22.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
build:
needs: auto-cancel
name: "Build & Deploy"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "Update apt package list"
run: |
sudo apt-get update
- name: "Search changes for applicable tests"
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
tex:
- 'code/stable/**/*.tex'
md:
- code/stable/**/*.md
- code/stable/**/book.toml
- name: "Install system requirements"
run: |
sudo apt-get install -y --fix-missing libgmp-dev python3 graphviz doxygen fonts-lmodern texlive-bibtex-extra texlive-latex-extra texlive-science texlive-xetex texlive-luatex g++ default-jdk mono-devel inkscape
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
cargo install mdbook
- name: "Update PATH"
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "$HOME/.swift/usr/bin" >> $GITHUB_PATH
- name: "Install Stack"
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-no-global: true
stack-version: 'latest'
- name: "Cache dependencies"
uses: actions/cache@v4.1.2
with:
path: |
~/.stack
~/.cabal/packages
~/.cabal/store
code/.stack-work/
code/website/.stack-work/
~/.local/bin/graphmod
key: ${{ runner.os }}-store-${{ hashFiles('code/stack.yaml') }}
- name: "Clean previous run"
run: make clean
- name: "Install dependencies"
run: make stackArgs="--no-terminal" deps
- name: "Build"
run: make code stackArgs="--no-terminal" GHCFLAGS="-Werror"
- name: "Test built artifacts against stable"
run: make stackArgs="--no-terminal" GHCFLAGS="-Werror" NOISY=yes
- name: "Compile GOOL examples"
run: make codegenTest
- name: "Compile generated TeX artifacts"
run: make -j tex SUMMARIZE_TEX=yes
if: ${{ steps.changes.outputs.tex == 'true' || fromJSON(env.is_deployment) }}
- name: "Compile generated software artifacts"
run: make gool
- name: "Create Doxygen for generated software artifacts"
run: make doxygen
- name: "Generate Haddock docs (as test)"
run: make docs
if: ${{ !fromJSON(env.is_deployment) }}
- name: "Generate Haddock docs (full + std)"
run: FULL=1 make docs
if: ${{ fromJSON(env.is_deployment) }}
- name: "Generate module dependency graphs"
run: make graphs
- name: "Analyze Drasil code"
run: make analysis
- name: "Convert analysis graphs into dot and circo SVGs" # only needed in deployments, not required for tests
run: make convertAnalyzed
if: ${{ fromJSON(env.is_deployment) }}
- name: "Build trace graphs" # only needed in deployments, not required for tests
run: make tracegraphs
if: ${{ fromJSON(env.is_deployment) }}
- name: "Build mdBook Examples"
run: make mdbook_build
if: ${{ steps.changes.outputs.md == 'true' || fromJSON(env.is_deployment) }}
- name: "Build website generator"
run: make website
- name: "Test Built Website against Stable Version"
run: make test_website NOISY=yes
- name: "Prepare full website deployment environment"
run: make deploy_lite
- name: "Deploy 🚀"
if: ${{ fromJSON(env.is_deployment) }}
uses: JamesIves/github-pages-deploy-action@v4.7.2
with:
git-config-name: ${{ secrets.BOT_NAME }}
git-config-email: ${{ secrets.BOT_EMAIL }}
token: ${{ secrets.BOT_TOKEN }}
branch: gh-pages
folder: code/deploy
commit-message: "${{ secrets.BOT_NAME }} deploy of main@${{ github.sha }}"