From a16525ec851d4121577bb8566b08f09bbb09fda4 Mon Sep 17 00:00:00 2001 From: oxalica Date: Mon, 19 Sep 2022 09:45:49 +0800 Subject: [PATCH] Add GitHub CI --- .github/workflows/ci.yml | 74 ++++++++++++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6cc0456 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,74 @@ +name: CI +on: + pull_request: + push: + +env: + RUST_BACKTRACE: full + +jobs: + format: + name: Format + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + components: rustfmt + - name: Check format + run: cargo fmt --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: clippy + - name: Check clippy + run: cargo clippy --all -- -D warnings + + test: + name: Test + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + channel: [stable, beta] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.channel }} + - name: Build + run: cargo build --all + - name: Test + run: cargo test --all -- --include-ignored + + nix: + name: Nix packaging + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install Nix + uses: cachix/install-nix-action@v17 + - name: Flake check + run: nix flake check --no-update-lock-file --show-trace --verbose + - name: Flake build + run: nix build --no-update-lock-file --show-trace --verbose --print-build-logs diff --git a/README.md b/README.md index aa0d2dd..c872cf4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ nil: Language server for Nix Expression Language +[![CI](https://github.com/oxalica/nil/actions/workflows/ci.yml/badge.svg)](https://github.com/oxalica/nil/actions/workflows/ci.yml) + 🚧 *This project is under development, but be happy to try it out!* Super fast incremental analysis! Scans `all-packages.nix` in less than 0.1s and completes with no delay!