diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 7498532..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -x-defs: - default_docker: &rust_docker [{image: "rustlang/rust:nightly"}] - -version: 2 -jobs: - test: - docker: *rust_docker - steps: - - checkout - - restore_cache: - keys: - - ds-v1-docker--{{ arch }}-{{ checksum "Cargo.lock" }} - - ds-v1-docker--{{ arch }}- - - run: cargo fetch - - run: cargo build - - save_cache: - key: ds-v1-docker--{{ arch }}-{{ checksum "Cargo.lock" }} - paths: - - "/usr/local/cargo" - - "./target" - - run: cargo test - - rustfmt: - docker: *rust_docker - steps: - - checkout - # No need for cache... - - run: rustup component add rustfmt --toolchain nightly || cargo install --git ssh://git@github.com/rust-lang/rustfmt.git --force rustfmt-nightly - - run: cargo fmt --verbose --all -- --check - - clippy: - docker: *rust_docker - steps: - - checkout - # No need for cache... - - run: rustup component add clippy --toolchain=nightly || cargo install --git ssh://git@github.com/rust-lang/rust-clippy.git --force clippy - - run: cargo clippy --verbose --all-targets --all-features -- -D warnings - - compile: - docker: *rust_docker - steps: - - checkout - - restore_cache: - keys: - - ds-v1-docker--{{ arch }}-{{ checksum "Cargo.lock" }} - - ds-v1-docker--{{ arch }}- - - run: cargo build - - docker-build: - docker: [{image: "docker:stable"}] - steps: - - setup_remote_docker - - checkout - - restore_cache: - keys: - - ds-v1-docker--{{ arch }}-image-{{ .Revision }} - - ds-v1-docker--{{ arch }}-image - - run: docker build . - - run: docker save $(docker images --quiet --all) > /tmp/image.tar - - save_cache: - key: ds-v1-docker--{{ arch }}-image-{{ .Revision }} - paths: - - /tmp/image.tar - -workflows: - version: 2 - general: - jobs: - - rustfmt - - clippy - - test - - compile: - requires: [ rustfmt, test ] - - docker-build: - requires: [ compile ] - - -# TODO nightly after rust nightlies get published -# e.g. 4am diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e0fee14 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,56 @@ +name: Check, test, and build the code + +on: + push: + schedule: + - cron: 15 */6 * * * + +jobs: + check: + name: Check the code + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + rust: [nightly] + steps: + - name: Install the appropriate Rust toolchain + run: | + rustup toolchain install ${{ matrix.rust }} + rustup default ${{ matrix.rust }} + - uses: actions/checkout@v1 + - name: Run rustfmt + run: | + rustup component add rustfmt + cargo fmt -- --check + - name: Run clippy + run: | + rustup component add clippy + cargo clippy -- -D clippy::all -W clippy::cargo -W clippy::pedantic + + test: + name: Run tests and measure coverage + runs-on: ubuntu-latest + strategy: + matrix: + rust: [nightly] + steps: + - name: Install the appropriate Rust toolchain + run: | + rustup toolchain install ${{ matrix.rust }} + rustup default ${{ matrix.rust }} + - uses: actions/checkout@v1 + - name: Run tests + run: | + cargo test + - name: Generate and upload coverage + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: | + cargo install --force cargo-tarpaulin + cargo tarpaulin --out Xml + bash <(curl -s https://codecov.io/bash) + - uses: actions/upload-artifact@master + with: + name: cobertura.xml + path: cobertura.xml