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 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
name: CI
on:
push:
branches:
- master
- for-master
- github-ci
tags:
- v*
pull_request:
branches:
- master
- for-master
jobs:
check_commits_job:
name: "Check commits"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Developer's Certificate of Origin"
run: |
[ "${{ github.event_name }}" = "push" ] &&
from="refs/remotes/origin/${{ github.event.repository.default_branch }}" ||
from="${{ github.event.pull_request.base.sha }}"
tests/ci/check-dco.sh "$from..HEAD"
distcheck_job:
name: "Distcheck"
runs-on: ubuntu-latest
needs: [ check_commits_job ]
steps:
- name: "Check out repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Install dependencies"
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq gcc autoconf automake autopoint libtool libtool-bin libpam0g-dev bison flex gettext valgrind sparse
- name: "Configure"
run: |
tests/configure.sh --datadir="$PWD/data" --enable-memcheck
- name: "Clean"
run: |
make clean
- name: "Build"
run: |
make V=1
- name: "Distcheck"
run: |
sudo -E make distcheck
- name: "Upload artifacts"
if: failure()
uses: actions/upload-artifact@v4
with:
name: artifact-distcheck
path: |
config.log
tests/testsuite.dir
tests/testsuite.log
kbd-*/_build/sub/tests/testsuite.dir
kbd-*/_build/sub/tests/testsuite.log
if-no-files-found: ignore
retention-days: 1
local_build_job:
name: "Check with ${{ matrix.compiler }} / ${{ matrix.libc }} on x86_64"
strategy:
matrix:
include:
- os: ubuntu-latest
cflags:
compiler: gcc
libc: glibc
configure:
check: unittest e2e
- os: ubuntu-latest
cflags:
compiler: clang
libc: glibc
configure:
check: unittest e2e
- os: ubuntu-latest
cflags: -idirafter /usr/include/ -idirafter /usr/include/x86_64-linux-gnu/
compiler: gcc
libc: musl
configure: --host=x86_64-linux-musl --disable-vlock --without-zlib --without-bzip2 --without-lzma --without-zstd
check: unittest e2e
fail-fast: false
runs-on: ${{ matrix.os }}
needs: [ distcheck_job ]
env:
CHECK_KEYWORDS: ${{ matrix.check }}
SANDBOX: priviliged
TTY: /dev/tty60
HAVE_VGA: 1
steps:
- name: "Check out repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: sudo apt-get update -y -qq
- run: sudo apt-get install -y -qq autoconf automake autopoint libtool libtool-bin libpam0g-dev bison flex gettext kbd strace valgrind
- run: sudo apt-get install -y -qq gcc clang musl musl-dev musl-tools
- name: "Configure"
run: |
tests/configure.sh --datadir="$PWD/tests/data" --enable-memcheck ${{ matrix.configure }}
- name: "Build"
run: |
make V=1 CFLAGS+="-g -O0 ${{ matrix.cflags }}"
- name: "Check"
run: |
sudo -E tests/check.sh
- name: "Upload artifacts"
if: failure()
uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.compiler }}-${{ matrix.libc }}
path: |
config.log
tests/testsuite.dir
tests/testsuite.log
if-no-files-found: ignore
retention-days: 1
qemu_build_job:
name: "Check on ${{ matrix.arch }}"
strategy:
matrix:
include:
- arch: x86_64
- arch: s390x
- arch: ppc64el
fail-fast: false
runs-on: ubuntu-latest
needs: [ check_commits_job, distcheck_job ]
env:
CI_ARCH: ${{ matrix.arch }}
CI_UBUNTU_VERSION: "24.10"
steps:
- name: "Check out repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Prepare Node"
run: |
for m in kvm kvm-amd kvm-intel; do sudo modprobe -v "$m" ||:; done
test -c /dev/kvm && sudo chmod -v 666 /dev/kvm ||:
- name: "Install dependencies"
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq qemu-system ssh cloud-image-utils
- name: "Prepare cloud image for VM"
run: tests/ci/create-cloud-image.sh
- name: "Start VM"
run: |
tests/ci/start-qemu-vm.sh "$PWD"
while ! tests/ci/vm-ssh.sh ubuntu@localhost /bin/true; do sleep 1; done
timeout-minutes: 30
- name: "Install dependencies into VM"
run: tests/ci/vm-ssh.sh ubuntu@localhost /opt/tests/ci/qemu-install-dependencies.sh
- name: "Copy sources into VM"
run: |
tests/ci/vm-ssh.sh ubuntu@localhost mkdir /tmp/kbd
tests/ci/vm-scp.sh -r . ubuntu@localhost:/tmp/kbd/
- name: "Build project in the VM"
run: |
rc=0
tests/ci/vm-ssh.sh ubuntu@localhost /opt/tests/ci/qemu-run-build-and-tests.sh ${{ matrix.arch }} || rc=1
tests/ci/vm-scp.sh ubuntu@localhost:artifacts.tar /tmp/${{ matrix.arch }}/ ||:
exit $rc
- name: "Upload artifacts"
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-on-${{ matrix.arch }}-artifacts
path: |
/tmp/${{ matrix.arch }}/qemu.log
/tmp/${{ matrix.arch }}/artifacts.tar
if-no-files-found: ignore
retention-days: 1
|