diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-05-06 14:43:04 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-05-18 11:34:42 +0200 |
| commit | 24d9114275cf8e2aa279feabd03c58f411f38a92 (patch) | |
| tree | 4d3b94df3a439e5100a179c99bf96ebb15781420 /.github | |
| parent | 37137150cb3bec5efc9112447b03d4999612e3d4 (diff) | |
.github/workflows: add CI workflow
Switch from Travis to Github Actions for testing.
This is faster and is better integrated with github.
Update #1699
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/ci.yml | 71 | ||||
| -rwxr-xr-x | .github/workflows/run.sh | 11 |
2 files changed, 82 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..43c727f78 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,71 @@ +# Copyright 2020 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +# GitHub workflow reference: +# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions + +name: ci +on: [push, pull_request] +jobs: + smoke: + runs-on: ubuntu-latest + steps: + # Checks out syzkaller repo at the path. + - name: checkout + uses: actions/checkout@v2 + with: + path: gopath/src/github.com/google/syzkaller + # Caches everything in .cache dir, in partiuclar we want to cache go-build and golangci-lint stuff. + # For reference see: + # https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows#using-the-cache-action + - name: cache + uses: actions/cache@v1 + with: + path: .cache + key: cache + # Run make presubmit_smoke. + - name: run + run: gopath/src/github.com/google/syzkaller/.github/workflows/run.sh make presubmit_smoke + # Upload coverage report to codecov.io. + - name: codecov + uses: codecov/codecov-action@v1 + with: + file: gopath/src/github.com/google/syzkaller/.coverage.txt + arch: + runs-on: ubuntu-latest + needs: [smoke] + if: ${{ needs.smoke.result == 'success' }} + steps: + - name: checkout + uses: actions/checkout@v2 + with: + path: gopath/src/github.com/google/syzkaller + - name: cache + uses: actions/cache@v1 + with: + path: .cache + key: cache + - name: run + run: gopath/src/github.com/google/syzkaller/.github/workflows/run.sh make presubmit_arch + fuzzit: + runs-on: ubuntu-latest + needs: [smoke] + if: ${{ needs.smoke.result == 'success' }} + steps: + - name: checkout + uses: actions/checkout@v2 + with: + path: gopath/src/github.com/google/syzkaller + - name: cache + uses: actions/cache@v1 + with: + path: .cache + key: cache + - name: regression + if: ${{ github.event_name == 'pull_request' }} + run: gopath/src/github.com/google/syzkaller/.github/workflows/run.sh tools/fuzzit.sh local-regression + - name: fuzzing + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + env: + FUZZIT_API_KEY: ${{ secrets.FUZZIT_API_KEY }} + run: gopath/src/github.com/google/syzkaller/.github/workflows/run.sh tools/fuzzit.sh fuzzing diff --git a/.github/workflows/run.sh b/.github/workflows/run.sh new file mode 100755 index 000000000..82fc6fa05 --- /dev/null +++ b/.github/workflows/run.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# Copyright 2020 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +export HOME="$PWD" +mkdir -p .cache +set -o pipefail +# Run the specified command in syz-env and convert error messages to github format: +# https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message +gopath/src/github.com/google/syzkaller/tools/syz-env $@ | \ + sed -E 's#\s*(.+):([0-9]+):([0-9]+): (.+)#\0\n::error file=\1,line=\2,col=\3::\4#' |
