Add GitHub Action Workflow for CI

This commit adds a GitHub Actions workflow to replace both CircleCI and
LinuxKit CI.

It will build the Linuxkit binary, run tests and upload artifacts

It replaces the Integration Tests that are run by Linuxkit CI via
the make ci or make ci-pr targets with multiple sets of Integration
Tests that are run in parallel.

It does not yet test GCP. The GCP test in LinuxKit CI could be moved to RTF

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
This commit is contained in:
Dave Tucker 2019-11-16 00:51:55 +00:00
parent fce020a111
commit a98046999f

181
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,181 @@
name: LinuxKit CI
on: [push, pull_request]
jobs:
build:
name: Build & Test
strategy:
matrix:
arch:
- amd64-linux
- arm64-linux
- s390x-linux
- amd64-darwin
- amd64-windows.exe
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.11
uses: actions/setup-go@v1
with:
go-version: 1.11
id: go
- name: Check out code
uses: actions/checkout@v1
with:
path: ./src/github.com/linuxkit/linuxkit
- name: Get pre-requisites
run: |
echo "::set-env name=PATH::$PATH:$(go env GOPATH)/bin"
go get -u golang.org/x/lint/golint
go get -u github.com/gordonklaus/ineffassign
env:
GOPATH: ${{runner.workspace}}
- name: Lint
run: |
make local-check
env:
GOPATH: ${{runner.workspace}}
- name: Build
run: |
make LOCAL_TARGET=bin/linuxkit-${{matrix.arch}} local-build
env:
GOPATH: ${{runner.workspace}}
- name: Checksum
run: cd bin && sha256sum linuxkit-${{matrix.arch}} > linuxkit-${{matrix.arch}}.SHA256SUM
- name: Test
run: make local-test
env:
GOPATH: ${{runner.workspace}}
- name: Upload binary
uses: actions/upload-artifact@v1.0.0
with:
name: linuxkit-${{matrix.arch}}
path: bin
build_packages:
name: Build Packages
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
with:
path: ./src/github.com/linuxkit/linuxkit
- name: Install Tools
run: |
make
sudo make install
- name: Build Packages
run: |
make -C pkg build
test_packages:
name: Packages Tests
needs: [ build_packages, build ]
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
with:
path: ./src/github.com/linuxkit/linuxkit
- name: Install Tools
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get install -qy expect
make
sudo make install
- name: Run Tests
run: |
cd test
rtf -l build -v run -x linuxkit.packages
test_kernel:
name: Kernel Tests
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
with:
path: ./src/github.com/linuxkit/linuxkit
- name: Install Tools
run: |
make
sudo make install
- name: Run Tests
run: |
cd test
rtf -l build -v run -x linuxkit.kernel
test_linuxkit:
name: LinuxKit Build Tests
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
with:
path: ./src/github.com/linuxkit/linuxkit
- name: Install Tools
run: |
make
sudo make install
- name: Run Tests
run: |
cd test
rtf -l build -v run -x linuxkit.build
test_platforms:
name: Platform Tests
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
with:
path: ./src/github.com/linuxkit/linuxkit
- name: Install Tools
run: |
make
sudo make install
- name: Run Tests
run: |
cd test
rtf -l build -v run -x linuxkit.platforms
test_security:
name: Security Tests
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
with:
path: ./src/github.com/linuxkit/linuxkit
- name: Install Tools
run: |
make
sudo make install
- name: Run Tests
run: |
cd test
rtf -l build -v run -x linuxkit.security