summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 1b4ed46bf57e12b0a26de3c19e435ba4a7f6bd7a (plain) (blame)
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
---

stages:
    - test
    - coverage

cache:
    paths:
        - .cache

variables:
    GIT_SUBMODULE_STRATEGY: recursive

.install_fennel: &fennel |-
    cd "$CI_PROJECT_DIR"
    mkdir -p .cache
    cd .cache
    [ -d fennel ] || git clone -q https://git.sr.ht/~technomancy/fennel
    cd fennel || exit -1
    git checkout -q .
    git checkout -q main
    git pull -q --rebase
    git checkout 0.8.1
    make clean
    make install
    cd "$CI_PROJECT_DIR"

.install_fenneldoc: &fenneldoc |-
    cd "$CI_PROJECT_DIR"
    mkdir -p .cache
    cd .cache
    [ -d fenneldoc ] || git clone -q https://gitlab.com/andreyorst/fenneldoc.git
    cd fenneldoc || exit -1
    git checkout -q .
    git checkout -q master
    git pull -q --rebase
    git checkout -q v0.1.5
    git submodule update --init
    make clean
    make install
    cd "$CI_PROJECT_DIR"

Lua:
    image: alpine:edge
    stage: test
    before_script:
        - >
            apk add -q
            lua5.2 lua5.3 lua5.3-dev lua5.4 luarocks5.3
            git make gcc musl-dev
        - luarocks-5.3 install luafilesystem
        - export LUA=lua5.3
        - *fennel
        - *fenneldoc
    script:
        - LUA_EXECUTABLES="lua5.2 lua5.3 lua5.4" make testall >/dev/null

# Luajit actually is an impostor in Alpine, as the package actually
# uses Moonjit implementation, which is different from what I'm
# working with, so Fedora 33 image is used, which as of this moment
# has latest Luajit available
Luajit:
    image: fedora:33
    stage: test
    before_script:
        - dnf install -y -q lua luajit git make
        - *fennel
    script:
        - LUA=luajit make test

# We install fennel via luarocks because I don't want to figure out
# how to install luacov without luarocks
Coverage:
    image: alpine:3.12.1
    stage: coverage
    before_script:
        - apk add -q lua5.3 lua5.3-dev luarocks5.3 make gcc musl-dev
        - luarocks-5.3 install fennel
        - luarocks-5.3 install luacov
        - luarocks-5.3 install luacov-console
    script:
        - LUA=lua5.3 make luacov-console >/dev/null
        - luacov-console --no-colored -s