-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from Travis CI to GitHub Actions
travis-ci.org is being shut down, so switch to GitHub Actions. It should be mostly equivalent, but I did drop functionality in a couple cases: - Publishing release binaries. I don't think providing Linux binaries is useful, since people build their own anyway. So I left this out. - Build and testing on ppc64le. GitHub Actions only natively supports x86. I tried uraimo/run-on-arch-action, which uses Docker and QEMU user-mode emulation, but the fscrypt tests can't be run because QEMU user-mode emulation doesn't support all the needed system calls.
- Loading branch information
Showing
4 changed files
with
131 additions
and
97 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,127 @@ | ||
# | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
# use this file except in compliance with the License. You may obtain a copy of | ||
# the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations under | ||
# the License. | ||
# | ||
|
||
name: CI | ||
on: [pull_request, push] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
go: ['1.14', '1.13', '1.12', '1.11'] | ||
name: Build (Go ${{ matrix.go }}) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Install dependencies | ||
run: sudo apt-get install -y libpam0g-dev | ||
- name: Build | ||
run: GO111MODULE=on make | ||
|
||
build-32bit: | ||
name: Build (32-bit) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
- name: Install dependencies | ||
run: | | ||
sudo dpkg --add-architecture i386 | ||
sudo apt-get update | ||
sudo apt-get install -y libpam0g-dev:i386 gcc-multilib | ||
- name: Build | ||
run: CGO_ENABLED=1 GOARCH=386 make | ||
|
||
run-integration-tests: | ||
name: Run integration tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
- name: Install dependencies | ||
run: sudo apt-get install -y libpam0g-dev e2fsprogs keyutils | ||
- name: Run integration tests | ||
run: | | ||
make test-setup | ||
keyctl link @u @s | ||
make coverage.out | ||
make test-teardown | ||
- name: Report coverage | ||
uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
path-to-profile: coverage.out | ||
|
||
# This isn't working currently because qemu user-mode emulation doesn't | ||
# support passing through the keyctl() system call and the fscrypt ioctls. | ||
# Hopefully GitHub Actions will natively support other architectures soon... | ||
# | ||
# run-integration-tests-other-arch: | ||
# name: Run integration tests (${{ matrix.arch }}) | ||
# strategy: | ||
# matrix: | ||
# arch: [armv7, aarch64, ppc64le] | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - uses: uraimo/run-on-arch-action@v2.0.5 | ||
# with: | ||
# arch: ${{ matrix.arch }} | ||
# distro: buster | ||
# githubToken: ${{ github.token }} | ||
# # Needed for 'make test-setup' to mount the test filesystem. | ||
# dockerRunArgs: --privileged | ||
# install: | | ||
# apt-get update | ||
# apt-get install -y build-essential git sudo golang-go \ | ||
# libpam0g-dev e2fsprogs keyutils | ||
# run: | | ||
# export GO111MODULE=on | ||
# make test-setup | ||
# keyctl link @u @s | ||
# make test | ||
# make test-teardown | ||
|
||
run-cli-tests: | ||
name: Run command-line interface tests | ||
# The cli tests require kernel 5.4 or later, and thus Ubuntu 20.04 or later. | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
- name: Install dependencies | ||
run: sudo apt-get install -y libpam0g-dev e2fsprogs expect keyutils | ||
- name: Run command-line interface tests | ||
run: make cli-test | ||
|
||
generate-format-and-lint: | ||
name: Generate, format, and lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get install -y libpam0g-dev shellcheck | ||
make tools | ||
- name: Generate | ||
run: make gen && bin/files-changed proto | ||
- name: Format | ||
run: make format && bin/files-changed format | ||
- name: Lint | ||
run: make lint |
This file was deleted.
Oops, something went wrong.
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 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