-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (66 loc) · 2.08 KB
/
test.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
# Run when we create a new github release
---
on: push
name: Test process
defaults:
run:
shell: bash
jobs:
create-debs:
name: Run tests
strategy:
fail-fast: false
matrix:
container:
- ubuntu:14.04
- debian:testing
runs-on: ubuntu-latest
container:
image: ${{ matrix.container }}
options: --privileged
steps:
- name: Drop environment details for debugging
run: |
echo "::group::environment variables"
env
echo "::endgroup::"
echo "::group::os-release"
cat /etc/os-release
echo "::endgroup::"
- name: Get OS details
id: os
run: |
set -o allexport
source /etc/os-release
echo "::set-output name=distribution::$ID"
echo "::set-output name=version::${VERSION_ID}"
[[ $VERSION_ID == "14.04" ]] && VERSION_CODENAME=trusty
[[ $PRETTY_NAME == *bookworm* ]] && VERSION_CODENAME=bookworm
echo "::set-output name=codename::${VERSION_CODENAME}"
- name: Install required build environment packages
run: |
apt-get update
apt-get install --yes libc6-dev gcc make autoconf automake sudo e2fslibs-dev
env:
DEBIAN_FRONTEND: "noninteractive"
- name: Checkout code
uses: actions/checkout@v2
- name: Compile
run: autoreconf --verbose --install --force && ./configure && make
- name: Prepare system for tests
# Need to run as a non-root user who can run sudo
# Need to run on an ext[234] filesystem
run: |
useradd testuser -G sudo
echo "testuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
chown -R testuser .
dd if=/dev/zero of=loopfile bs=1M count=10
losetup -f loopfile
mkfs.ext4 -F loopfile
mkdir testdir
mount -o loop loopfile testdir
- name: Run the tests
run: sudo --preserve-env --user=testuser make test
env:
USE_SUDO_FOR_TESTS: 1
TEST_DIR: testplay