-
Notifications
You must be signed in to change notification settings - Fork 23
145 lines (143 loc) · 5.21 KB
/
bygg.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
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
name: Bygg KonCEPT
on:
push:
branches:
- master
paths-ignore:
- '**.md'
pull_request:
branches:
- master
paths-ignore:
- '**.md'
jobs:
analysera-koden:
name: 'Analysera koden'
runs-on: ubuntu-22.04
steps:
- name: 'Checka ut koden'
uses: actions/checkout@v4
- name: 'Installera Ubuntu-paket'
run: |
sudo apt-get -qq update
sudo apt-get --quiet --assume-yes --verbose-versions install \
chktex
- name: 'Skapa rapporter'
run: |
echo "| Statistik | Antal |" >> $GITHUB_STEP_SUMMARY
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
make images_linked
echo "| Bildfiler med referenser | $(cat images_linked.txt | wc -l) |" >> $GITHUB_STEP_SUMMARY
make images_unlinked
echo "| Bildfiler utan referenser | $(cat images_unlinked.txt | wc -l) |" >> $GITHUB_STEP_SUMMARY
make long_lines
echo "| Kodrader längre än 80 tecken | $(cat long_lines.txt | wc -l) |" >> $GITHUB_STEP_SUMMARY
make comment_lines
echo "| Kommentarrader | $(cat comment_lines.txt | wc -l) |" >> $GITHUB_STEP_SUMMARY
- name: 'Kör LaTeX-kontroll'
continue-on-error: true
run: (chktex -v1 -n8 -n13 -n24 -n32 --output chktex.log koncept.tex); if [ $? -lt 3 ]; then (exit 0); else (exit 3); fi
# n8 eftersom det är fel tankstreckslängd för svenska.
# n13 eftersom det inte används långa blanksteg i svenska.
# n24 eftersom KonCEPT har använder index vid styckets början, inte vid tecken.
# n32 eftersom det är fel citationstecken för svenska.
- name: 'Skriv ut fel'
run: "grep -F 'Error' chktex.log || echo ':white_check_mark: chktex hittade inga fel.' >> $GITHUB_STEP_SUMMARY"
- name: 'Spara rapporter'
uses: actions/upload-artifact@v4
with:
name: rapporter
path: |
images_linked.txt
images_unlinked.txt
long_lines.txt
comment_lines.txt
chktex.log
bygg-pdf:
name: 'Bygg PDF'
runs-on: ubuntu-22.04
steps:
- name: 'Checka ut koden'
uses: actions/checkout@v4
- name: 'Installera Ubuntu-paket'
run: |
sudo apt-get -qq update
sudo apt-get --quiet --assume-yes --verbose-versions install \
texlive \
texlive-lang-european \
texlive-science \
texlive-fonts-recommended \
texlive-fonts-extra \
latexmk \
language-pack-sv
- name: 'Sätt systemspråk till svenska'
run: |
sudo locale-gen sv_SE.UTF-8
sudo localectl set-locale LANG="sv_SE.UTF-8"
- name: 'Kopiera info om repository till filer'
run: |
echo $GITHUB_SHA | cut -c1-7 > SHA.tmp
echo $GITHUB_REF_NAME > branch.tmp
- name: 'Bygg koncept.pdf'
run: make koncept.pdf
- name: 'Visa programversion'
run: |
echo "<pre>$(latexmk -v)</pre>" >> $GITHUB_STEP_SUMMARY
echo "<pre>$(sed -n '1p' koncept.log)</pre>" >> $GITHUB_STEP_SUMMARY
- name: 'Lägg till versionsinformation i filnamnet'
run: mv koncept.pdf koncept.$(cat VERSION.txt)+b${{ github.run_id }}.$(cat SHA.tmp).pdf
- name: 'Visa checksumma'
run: echo "<pre>$(sha256sum *.pdf)</pre>" >> $GITHUB_STEP_SUMMARY
- name: 'Spara artefakt'
uses: actions/upload-artifact@v4
with:
name: koncept-pdf
path: |
koncept*.pdf
koncept.log
bygg-epub:
name: 'Bygg EPUB (experimentell)'
continue-on-error: true
runs-on: ubuntu-22.04
steps:
- name: 'Checka ut koden'
uses: actions/checkout@v4
- name: 'Installera Ubuntu-paket'
run: |
sudo apt-get -qq update
sudo apt-get --quiet --assume-yes --verbose-versions install \
texlive \
texlive-extra-utils \
texlive-lang-european \
texlive-science \
texlive-fonts-recommended \
texlive-fonts-extra \
tidy \
language-pack-sv
- name: 'Sätt systemspråk till svenska'
run: |
sudo locale-gen sv_SE.UTF-8
sudo localectl set-locale LANG="sv_SE.UTF-8"
- name: 'Kopiera info om repository till filer'
run: |
echo $GITHUB_SHA | cut -c1-7 > SHA.tmp
echo $GITHUB_REF_NAME > branch.tmp
- name: 'Bygg koncept.epub'
continue-on-error: true
run: make koncept.epub
- name: 'Visa programversion'
run: |
echo "<pre>$(tex4ebook --version)</pre>" >> $GITHUB_STEP_SUMMARY
echo "<pre>$(sed -n '1p' koncept.log)</pre>" >> $GITHUB_STEP_SUMMARY
- name: 'Lägg till versionsinformation i filnamnet'
continue-on-error: true
run: mv koncept.epub koncept.$(cat VERSION.txt)+b${{ github.run_id }}.$(cat SHA.tmp).epub
- name: 'Visa checksumma'
run: echo "<pre>$(sha256sum *.epub)</pre>" >> $GITHUB_STEP_SUMMARY
- name: 'Spara artefakt'
uses: actions/upload-artifact@v4
with:
name: koncept-epub
path: |
koncept*.epub
koncept.log