-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This moves the remaining distribution tests from Travis to GitHub workflows.
- Loading branch information
Showing
3 changed files
with
49 additions
and
42 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,47 @@ | ||
--- | ||
name: Containers | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
env: | ||
GO_TOOLCHAIN: "1.15" | ||
GOPATH: "/opt" | ||
BUILD_DIR: "/opt/src/github.com/coreos/go-systemd" | ||
|
||
jobs: | ||
ditro-test: | ||
name: "Distro test" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
baseimage: ['debian:stretch', 'ubuntu:16.04', 'ubuntu:18.04'] | ||
steps: | ||
- run: sudo apt-get -qq update | ||
- name: Install libsystemd-dev | ||
run: sudo apt-get install libsystemd-dev | ||
- uses: actions/checkout@v2 | ||
- name: Setup go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ env['GO_TOOLCHAIN'] }} | ||
- name: Go build (source) | ||
run: ./scripts/travis/pr-test.sh build_source | ||
- name: Go build (tests) | ||
run: ./scripts/travis/pr-test.sh build_tests | ||
- name: Pull base image - ${{ matrix.baseimage }} | ||
run: docker pull ${{ matrix.baseimage }} | ||
- name: Install packages for ${{ matrix.baseimage }} | ||
run: docker run --privileged -e GOPATH=${GOPATH} --cidfile=/tmp/cidfile ${{ matrix.baseimage }} /bin/bash -c "apt-get update && apt-get install -y sudo build-essential git golang dbus libsystemd-dev libpam-systemd systemd-container" | ||
- name: Persist base container | ||
run: docker commit `cat /tmp/cidfile` go-systemd/container-tests | ||
- run: rm -f /tmp/cidfile | ||
- name: Run systemd from ${{ matrix.baseimage }} | ||
run: docker run --shm-size=2gb -d --cidfile=/tmp/cidfile --privileged -e GOPATH=${GOPATH} -v ${PWD}:${BUILD_DIR} go-systemd/container-tests /bin/systemd --system | ||
- name: Run tests | ||
run: docker exec --privileged `cat /tmp/cidfile` /bin/bash -c "cd ${BUILD_DIR} && ./scripts/travis/pr-test.sh run_tests" | ||
- name: Cleanup | ||
run: docker kill `cat /tmp/cidfile` |
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
This file was deleted.
Oops, something went wrong.