Skip to content

Commit

Permalink
ci: add integration tests to github actions
Browse files Browse the repository at this point in the history
This is Ubuntu 20.04 so cgroup v1 testing.

Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Nov 27, 2020
1 parent 06b737b commit 9590745
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: test
on:
push:
tags:
- v*
branches:
- master
pull_request:

jobs:
integration:
strategy:
matrix:
go-version: [1.14.x, 1.15.x]
criu-version: [3.15]
systemd: ["systemd", ""]
rootless: ["rootless", ""]
exclude:
# rootless + systemd is only supported with cgroupv2
- systemd: systemd
rootless: rootless
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
- name: install deps
run: |
sudo apt update
sudo apt install libseccomp-dev
- name: cache criu binary
id: cache-criu
uses: actions/cache@v2
with:
path: /usr/local/bin/criu
key: criu-bin0-${{ matrix.criu-version }}-${{ matrix.os }}
- name: install criu
if: steps.cache-criu.outputs.cache-hit != 'true'
run: |
sudo apt install libnet-dev libprotobuf-dev libprotobuf-c-dev protobuf-c-compiler protobuf-compiler python-protobuf libnl-3-dev libcap-dev
mkdir criu
curl -fsSL https://github.com/checkpoint-restore/criu/archive/v${{ matrix.criu-version }}.tar.gz | tar -C criu -xz --strip-components=1
pushd criu
echo 1 > .gitid
sudo make -j $(nproc) install-criu
popd
rm -rf criu
- name: install bats
uses: mig4/setup-bats@v1
with:
bats-version: 1.2.1
- name: install go ${{ matrix.go-version }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: build
run: sudo -E PATH="$PATH" make all
- name: add rootless user
if: matrix.rootless == 'rootless'
run: |
sudo useradd -u2000 -m -d/home/rootless -s/bin/bash rootless
# Allow root to execute `ssh rootless@localhost` in tests/rootless.sh
ssh-keygen -t ecdsa -N "" -f $HOME/rootless.key
sudo mkdir -m 0700 -p /home/rootless/.ssh
sudo cp $HOME/rootless.key.pub /home/rootless/.ssh/authorized_keys
sudo chown -R rootless.rootless /home/rootless
- name: set RUNC_USE_SYSTEMD
if: ${{ matrix.systemd }} == 'systemd'
run: echo "RUNC_USE_SYSTEMD=yes" >> $GITHUB_ENV
- name: test
run: sudo -E PATH="$PATH" make local${{ matrix.rootless }}integration

0 comments on commit 9590745

Please sign in to comment.