From a98046999f6c2de1aacc37287960dd5dd7cbd426 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Sat, 16 Nov 2019 00:51:55 +0000 Subject: [PATCH] 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 --- .github/workflows/build.yml | 181 ++++++++++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..3304d918b --- /dev/null +++ b/.github/workflows/build.yml @@ -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 \ No newline at end of file