Skip to content

chore: cli test script and simpler CI config #271

chore: cli test script and simpler CI config

chore: cli test script and simpler CI config #271

Workflow file for this run

name: Build & tests
on:
push:
branches:
- "**"
- "!main"
jobs:
build-cross:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v12
with:
name: novops
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: actions/cache@v3
with:
path: |
build/cache
key: ${{ runner.os }}-${{ runner.arch }}-podman
- run: nix develop .#cross -c make build-cross
- name: Upload built artifacts
uses: actions/upload-artifact@v3
with:
name: novops-build
if-no-files-found: error
path: |
build/novops
build/novops.zip
build/novops.zip.sha256sum
build/image.tar
# Build and push to cachix
build-flake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v12
with:
name: novops
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build --json | jq -r '.[].outputs | to_entries[].value' | cachix push novops
test-cargo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v12
with:
name: novops
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ runner.arch }}-cargo
- uses: actions/cache@v3
with:
path: |
~/.local/share/containers/storage/
key: ${{ runner.os }}-${{ runner.arch }}-podman
# Plain cargo tests
- run: nix develop -c make test
# Additional CLI-based tests
- run: nix develop -c make test