Skip to content

Split execution code #559

Split execution code

Split execution code #559

Workflow file for this run

name: builder
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Nix Setup
run: |
set -x
sudo mkdir /nix
sudo chown $USER /nix
mkdir -p $HOME/.config/nix
echo 'experimental-features = nix-command flakes' > $HOME/.config/nix/nix.conf
- name: Cache Nix DevEnv
uses: actions/cache@v3
env:
cache-name: cache-nix-dev-env
with:
path: |
/nix
/home/runner/.bash_profile
/home/runner/.nix-profile
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/flake.nix', '**/flake.lock') }}
- name: Cache Rust Artifacts
uses: actions/cache@v3
env:
cache-name: cache-rust-artifacts
with:
path: |
/home/runner/.rustup
/home/runner/.cargo
target
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock', '**/.cargo/config.toml', '**/rust-toolchain.toml', '**/flake.nix', '**/flake.lock') }}
- name: install nix
run: |
[ -f /home/runner/.nix-profile/etc/profile.d/nix.sh ] || sh <(curl -L https://nixos.org/nix/install) --no-daemon
- name: nixjs-rt
run: |
. /home/runner/.nix-profile/etc/profile.d/nix.sh
cd nixjs-rt
eval "$(nix print-dev-env)"
parallel --line-buffer --ctagstring "{}>\033[0m" scripts/{} ::: \
check-nix-pkg.sh \
check-npm-deps-hash.sh \
check-npm.sh
- name: Build
run: |
. /home/runner/.nix-profile/etc/profile.d/nix.sh
eval "$(nix print-dev-env)"
set -x
cargo fmt --check
cargo clippy -- --deny "warnings"
cargo test