diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..2e3fc5fe96e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI +on: + pull_request: + push: + branches: + - master +jobs: + test: + strategy: + fail-fast: false + matrix: + image: + - rust:latest + - rustlang/rust:nightly + runs-on: ubuntu-latest + container: + image: ${{ matrix.image }} + steps: + - uses: actions/checkout@v1 + - name: Test + run: ./scripts/test.sh + lint: + strategy: + fail-fast: false + matrix: + image: + - rust:latest + - rustlang/rust:nightly + runs-on: ubuntu-latest + container: + image: ${{ matrix.image }} + steps: + - uses: actions/checkout@v1 + - name: Lint + run: ./scripts/lint.sh diff --git a/scripts/lint.sh b/scripts/lint.sh new file mode 100755 index 00000000000..ce482f4b3c5 --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -eu + +if rustup component add clippy; then + cargo clippy --all-targets --all -- \ + `# Exit with a nonzero code if there are clippy warnings` \ + -Dwarnings \ + "$@" +fi diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 00000000000..72e42be6051 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -eu + +cargo test --all "$@"