diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 133fcb0..04c9f21 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -67,3 +67,23 @@ jobs: run: cargo test env: SQLX_OFFLINE: "true" + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: cachix/install-nix-action@v20 + with: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions-rs/toolchain@v1 + id: cargo + with: + toolchain: stable + components: clippy + - uses: cachix/cachix-action@v12 + with: + name: natsukagami + # If you chose API tokens for write access OR if you have a private cache + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Run nix build + run: nix build diff --git a/flake.nix b/flake.nix index a35ae76..446ee3b 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,10 @@ naersk.inputs.nixpkgs.follows = "nixpkgs"; flake-utils.url = "github:numtide/flake-utils"; }; + nixConfig = { + extra-substituters = [ "https://natsukagami.cachix.org" ]; + trusted-public-keys = [ "natsukagami.cachix.org-1:3U6GV8i8gWEaXRUuXd2S4ASfYgdl2QFPWg4BKPbmYiQ=" ]; + }; outputs = { self, nixpkgs, naersk, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; @@ -27,6 +31,8 @@ nativeBuildInputs = nixpkgs.lib.optionals pkgs.stdenv.isLinux (with pkgs; [ pkg-config ]); + + SQLX_OFFLINE = "true"; }; defaultPackage = packages.youmubot;