diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ddf5401..acf8377 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,11 +5,22 @@ on: branches: - main jobs: - tests: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@v31 with: nix_path: nixpkgs=channel:nixos-unstable - - run: nix-shell CI.nix --command "cargo build" + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - run: nix-shell CI.nix --command "cargo build && cargo doc" + + # uplood docs + - name: Upload to GitHub Pages (main branch only) + if: github.ref == 'refs/heads/main' + uses: actions/upload-pages-artifact@v3 + with: + path: target/doc/freeswitch_rs/ + - name: Deploy to GitHub Pages (main branch only) + if: github.ref == 'refs/heads/main' + uses: actions/deploy-pages@v4 diff --git a/CI.nix b/CI.nix index a7602a1..cb9e247 100644 --- a/CI.nix +++ b/CI.nix @@ -9,12 +9,11 @@ let pkgs = import (builtins.fetchTarball https://github.com/NixOS/nixpkgs/archiv rustPlatform = pkgs.makeRustPlatform { rustc = rustc; cargo = cargo;}; in pkgs.mkShell { + inputsFrom = [ (pkgs.callPackage ./default.nix { inherit rustPlatform; }) ]; buildInputs = [ - (import (builtins.fetchGit { url = "https://github.com/ash30/freeswitch"; ref = "nix"; rev = "2ecd26beeba14c0d66bda5ec471d68747e0b33b3";}) {}) + (import (builtins.fetchGit { url = "https://github.com/ash30/freeswitch"; ref = "nix"; rev = "d805600c0f4843528290a0d018bb1fbb5b56808f";}) {}) pkgs.pkg-config - pkgs.rust-bin.stable.latest.rust-analyzer # LSP Server pkgs.rust-bin.stable.latest.rustfmt # Formatter pkgs.rust-bin.stable.latest.clippy # Linter ]; - RUST_SRC_PATH = "${rustc}/lib/rustlib/src/rust/library/"; }