-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add integration tests to github actions
This is Ubuntu 20.04 so cgroup v1 testing. Signed-off-by: Kir Kolyshkin <[email protected]>
- Loading branch information
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |