Skip to content

Commit edba4e8

Browse files
authored
Add CI build
1 parent 91d10f7 commit edba4e8

File tree

3 files changed

+43
-16
lines changed

3 files changed

+43
-16
lines changed

.github/workflows/main.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Gitinfo Lua CI/CD
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Check out the repository
10+
uses: actions/checkout@v4
11+
with:
12+
path: gitinfo-lua
13+
fetch-tags: true
14+
fetch-depth: 0
15+
- name: Check out texmf
16+
uses: actions/checkout@v4
17+
with:
18+
repository: Xerdi/texmf-packaging
19+
path: texmf
20+
- name: Run the build process with Docker
21+
uses: addnab/docker-run-action@v3
22+
with:
23+
image: maclotsen/texlive:with-gf
24+
shell: bash
25+
options: --rm -i -v ${{ github.workspace }}/texmf:/root/texmf -v ${{ github.workspace }}:/build
26+
run: |
27+
git config --global --add safe.directory /build/gitinfo-lua
28+
make -C gitinfo-lua build
29+
- name: Archive Documentation
30+
uses: actions/upload-artifact@v3
31+
with:
32+
name: build
33+
path: ${{ github.workspace }}/gitinfo-lua/doc

Makefile

+10-5
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,38 @@ CONTRIBUTION = gitinfo-lua
22
VERSION = $(shell git describe --tags --always)
33
FILE = ${CONTRIBUTION}-${VERSION}.tar.gz
44
MANUAL = doc/${CONTRIBUTION}
5-
COMPILER = lualatex --shell-escape
5+
COMPILER = lualatex --shell-escape --interaction=nonstopmode
66

7-
TEST_PROJECT = ../git-test-project
7+
TEST_PROJECT ?= ../git-test-project
88

99
all: build clean
1010

1111
package: ${FILE}
1212

1313
build: ${MANUAL}.pdf
1414

15+
scenario: ${TEST_PROJECT}
16+
1517
clean:
1618
cd doc && latexmk -c 2> /dev/null
1719

1820
clean-all:
1921
cd doc && latexmk -C 2> /dev/null && \
2022
rm -f ${FILE}
2123

22-
${TEST_PROJECT}: doc/git-scenario.sh
23-
cd doc && ./git-scenario.sh
24+
${TEST_PROJECT}:
25+
mkdir -p ${TEST_PROJECT}
26+
cp -f doc/git-scenario.sh ${TEST_PROJECT}
27+
cd ${TEST_PROJECT} && git init
28+
cd ${TEST_PROJECT} && ./git-scenario.sh
2429

2530
${MANUAL}.aux: ${MANUAL}.tex
2631
cd doc && $(COMPILER) ${CONTRIBUTION}
2732

2833
${MANUAL}.idx: ${MANUAL}.aux
2934
cd doc && makeindex -s gind.ist ${CONTRIBUTION}.idx
3035

31-
${MANUAL}.pdf: ${TEST_PROJECT} ${MANUAL}.idx ${MANUAL}.tex tex/$(wildcard *.sty) scripts/$(wildcard *.lua)
36+
${MANUAL}.pdf: scenario ${MANUAL}.idx ${MANUAL}.tex tex/$(wildcard *.sty) scripts/$(wildcard *.lua)
3237
@echo "Creating documentation PDF"
3338
cd doc && $(COMPILER) ${CONTRIBUTION}
3439
while grep 'Rerun to get ' doc/${CONTRIBUTION}.log ; do cd doc && $(COMPILER) ${CONTRIBUTION} ; done

doc/git-scenario.sh

-11
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
set -e
44

5-
PROJECT_DIR="${1:-../../git-test-project}"
6-
75
set_author() {
86
git config user.name $1
97
git config user.email $2
@@ -23,15 +21,6 @@ charlie() {
2321
set_author 'Charlie' '[email protected]'
2422
}
2523

26-
if [[ -d "${PROJECT_DIR}" ]]; then
27-
rm -rf "${PROJECT_DIR}"
28-
fi
29-
30-
mkdir "${PROJECT_DIR}"
31-
cd "${PROJECT_DIR}"
32-
33-
git init
34-
3524
alice
3625

3726
echo "# My project" > README.md

0 commit comments

Comments
 (0)