forked from beyond-all-reason/Beyond-All-Reason
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.94 KB
/
Copy pathtest_unit.yml
File metadata and controls
59 lines (51 loc) · 1.94 KB
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
name: Run Unit Tests
on:
push:
branches: ['*']
pull_request:
branches: ['*']
jobs:
busted:
runs-on: ubuntu-latest
container:
# The `env`/`steps` contexts are not available in `container.image`
# (it's evaluated before the job's steps run), so the version is the
# one literal here. The cache key derives its version from the running
# container instead (see the "Detect Fedora version" step), so the two
# can never disagree.
image: fedora:43
steps:
- uses: actions/checkout@v5
- name: Detect Fedora version
id: fedora
run: echo "version=$(rpm -E %fedora)" >> "$GITHUB_OUTPUT"
- name: Install build deps + Lua 5.1
run: |
# Fedora 43's `lua` package is 5.4; the 5.1 interpreter ships
# under the compat-lua* names (matches BAR-Devtools' dev image).
dnf install -y --setopt=install_weak_deps=False \
git gcc gcc-c++ make \
compat-lua compat-lua-devel \
gpgme
- name: Install Lux via cargo-binstall
run: |
# GHA containers map $HOME to /github/home (not /root), so the
# cargo-binstall self-install lands at $HOME/.cargo/bin -- can't
# hardcode /root/.cargo/bin like the local Containerfile does.
curl -L --proto '=https' --tlsv1.2 -sSf \
https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh \
| bash
"$HOME/.cargo/bin/cargo-binstall" --no-confirm \
--version 0.28.3 \
--install-path /usr/local/bin \
lux-cli
ln -sf /usr/bin/lua-5.1 /usr/local/bin/lua
- name: Cache Lux dependencies
uses: actions/cache@v4
with:
path: .lux
key: lux-5.1-fedora${{ steps.fedora.outputs.version }}-${{ hashFiles('lux.lock') }}
restore-keys: |
lux-5.1-fedora${{ steps.fedora.outputs.version }}-
- name: Run busted
run: lx --lua-version 5.1 test