diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..f89ad93fa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI Checks + +on: [push, pull_request] + +jobs: + test: + name: Test on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Install dependencies + run: | + sudo apt update + sudo apt -y install build-essential clang libclang-dev llvm-dev libudev-dev pkg-config + + - name: Run tests + run: | + make test + + fmt: + name: rustfmt + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - run: rustup component add rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check diff --git a/.github/workflows/lints-stable.yml b/.github/workflows/lints-stable.yml new file mode 100644 index 000000000..b72485c21 --- /dev/null +++ b/.github/workflows/lints-stable.yml @@ -0,0 +1,23 @@ +name: Stable lints + +# We only run these on trial-merges of PRs to reduce noise. +on: pull_request + +jobs: + clippy: + name: Clippy (stable) + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy + override: true + - name: Run Clippy + uses: actions-rs/clippy-check@v1 + with: + name: Clippy (stable) + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features --release -- -D warnings diff --git a/.github/workflows/rust-build.yml b/.github/workflows/rust-build.yml deleted file mode 100644 index e384ffe6b..000000000 --- a/.github/workflows/rust-build.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build and Test - -on: [push, pull_request] - -jobs: - compile-and-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: rustfmt, clippy - - - name: Install Dependencies - run: | - sudo apt update - sudo apt -y install build-essential clang libclang-dev llvm-dev libudev-dev pkg-config - - - name: Create config directory - run: | - mkdir -p ~/.config/darkfi - - - name: Test with all features - run: | - cargo test --release --all-features - - - name: Clippy check - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --release --all-features