Move CI to github actions
This commit is contained in:
@@ -1,59 +0,0 @@
|
|||||||
version: 2.1
|
|
||||||
|
|
||||||
workflows:
|
|
||||||
version: 2.1
|
|
||||||
build:
|
|
||||||
jobs:
|
|
||||||
- build
|
|
||||||
- clippy
|
|
||||||
- coverage
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
docker:
|
|
||||||
- image: circleci/rust:latest
|
|
||||||
environment:
|
|
||||||
TZ: "/usr/share/zoneinfo/your/location"
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- restore_cache:
|
|
||||||
key: project-cache
|
|
||||||
- run:
|
|
||||||
name: Check formatting
|
|
||||||
command: cargo fmt -- --check
|
|
||||||
- run:
|
|
||||||
name: Stable Build
|
|
||||||
command: cargo build --all-features
|
|
||||||
- run:
|
|
||||||
name: Test
|
|
||||||
command: cargo test --all-features
|
|
||||||
- save_cache:
|
|
||||||
key: project-cache
|
|
||||||
paths:
|
|
||||||
- "~/.cargo"
|
|
||||||
- "./target"
|
|
||||||
clippy:
|
|
||||||
docker:
|
|
||||||
- image: circleci/rust:latest
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: Install cargo clippy
|
|
||||||
command: rustup component add clippy
|
|
||||||
- run:
|
|
||||||
name: Run cargo clippy
|
|
||||||
command: cargo clippy --all-features -- -Drust-2018-idioms -Dwarnings
|
|
||||||
|
|
||||||
coverage:
|
|
||||||
machine: true
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: Generate report
|
|
||||||
command: >
|
|
||||||
docker run --security-opt seccomp=unconfined -v $PWD:/volume
|
|
||||||
xd009642/tarpaulin:latest-nightly cargo tarpaulin -v --ciserver circle-ci
|
|
||||||
--out Lcov --all-features -- --test-threads 1
|
|
||||||
- run:
|
|
||||||
name: Upload
|
|
||||||
command: bash <(curl -s https://codecov.io/bash) -Z -f
|
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main, development ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ development ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
runs-on: "${{ matrix.platform.os }}-latest"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform: [
|
||||||
|
{ os: "windows", target: "x86_64-pc-windows-msvc" },
|
||||||
|
{ os: "windows", target: "i686-pc-windows-msvc" },
|
||||||
|
{ os: "ubuntu", target: "x86_64-unknown-linux-gnu" },
|
||||||
|
{ os: "ubuntu", target: "i686-unknown-linux-gnu" },
|
||||||
|
{ os: "ubuntu", target: "wasm32-unknown-unknown" },
|
||||||
|
{ os: "macos", target: "aarch64-apple-darwin" },
|
||||||
|
]
|
||||||
|
env:
|
||||||
|
TZ: "/usr/share/zoneinfo/your/location"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Cache .cargo and target
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo
|
||||||
|
./target
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||||
|
restore-keys: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
target: ${{ matrix.platform.target }}
|
||||||
|
profile: minimal
|
||||||
|
default: true
|
||||||
|
- name: Stable Build
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: --all-features --target ${{ matrix.platform.target }}
|
||||||
|
- name: Tests
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: test
|
||||||
|
args: --all-features
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
name: Coverage
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main, development ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ development ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
coverage:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
TZ: "/usr/share/zoneinfo/your/location"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Cache .cargo
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo
|
||||||
|
./target
|
||||||
|
key: ${{ runner.os }}-coverage-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||||
|
restore-keys: ${{ runner.os }}-coverage-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: nightly
|
||||||
|
profile: minimal
|
||||||
|
default: true
|
||||||
|
- name: Install cargo-tarpaulin
|
||||||
|
uses: actions-rs/install@v0.1
|
||||||
|
with:
|
||||||
|
crate: cargo-tarpaulin
|
||||||
|
version: latest
|
||||||
|
use-tool-cache: true
|
||||||
|
- name: Run cargo-tarpaulin
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: tarpaulin
|
||||||
|
args: --out Lcov --all-features -- --test-threads 1
|
||||||
|
- name: Upload to codecov.io
|
||||||
|
uses: codecov/codecov-action@v1
|
||||||
|
with:
|
||||||
|
fail_ci_if_error: true
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
name: Lint checks
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main, development ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ development ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
TZ: "/usr/share/zoneinfo/your/location"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Cache .cargo and target
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo
|
||||||
|
./target
|
||||||
|
key: ${{ runner.os }}-lint-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||||
|
restore-keys: ${{ runner.os }}-lint-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
profile: minimal
|
||||||
|
default: true
|
||||||
|
- run: rustup component add rustfmt
|
||||||
|
- name: Check formt
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fmt
|
||||||
|
args: --all -- --check
|
||||||
|
- run: rustup component add clippy
|
||||||
|
- name: Run clippy
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
args: --all-features -- -Drust-2018-idioms -Dwarnings
|
||||||
Reference in New Issue
Block a user