From 6db6fab34e7540e7939df1549e9a31b6bd3f349e Mon Sep 17 00:00:00 2001 From: oxalica Date: Sat, 2 Jan 2021 21:10:09 +0800 Subject: [PATCH] Add CI for check --- .github/workflows/ci.yaml | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000000..2aa5927dcee --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,47 @@ +name: CI +on: + pull_request: + push: + branches: + - master + - ci + +jobs: + check-flake: + name: Check flake + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 # Nix Flakes doesn't work on shallow clones + - name: Install Nix (flakes, nixos-unstable) + uses: cachix/install-nix-action@v12 + with: + install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20201221_9fab14a/install + extra_nix_config: | + experimental-features = nix-command flakes + nix_path: nixpkgs=channel:nixos-unstable + - name: Check flake + # Building checks is too slow. + run: nix flake check -v --show-trace --no-build --no-update-lock-file + + check-build-stable: + name: Check build the latest stable Rust + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 # Nix Flakes doesn't work on shallow clones + - name: Install Nix (flakes, nixos-unstable) + uses: cachix/install-nix-action@v12 + with: + install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20201221_9fab14a/install + extra_nix_config: | + experimental-features = nix-command flakes + nix_path: nixpkgs=channel:nixos-unstable + - name: Build + run: | + nix build ".#rust" -L + ./result/bin/rustc --version