mach-nix/.github/workflows/CI_NixPy.yml
2022-02-09 17:59:02 -07:00

113 lines
2.7 KiB
YAML

name: "mach-nix CI"
on:
pull_request:
branches: ["master"]
push:
branches: [master, dev, "ci*" ]
jobs:
## tasks per matrix element
cli-test:
name: Test mach-nix cli - ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install/Setup - NIX
uses: cachix/install-nix-action@v13
with:
nix_path: nixpkgs=channel:nixos-unstable
install_url: https://releases.nixos.org/nix/nix-2.6.0/install
extra_nix_config: |
experimental-features = nix-command flakes
sandbox = true
sandbox-fallback = false
- name: nix-env installation
run: nix-env -if . -A mach-nix
shell: bash
- name: cli test
run: |
export MACHNIX_VERSION=$GITHUB_SHA
mach-nix --version
echo "tensorflow" > reqs.txt
mach-nix env ./env -r reqs.txt
shell: bash
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install/Setup - NIX
uses: cachix/install-nix-action@v13
with:
nix_path: nixpkgs=channel:nixos-unstable
install_url: https://releases.nixos.org/nix/nix-2.6.0/install
extra_nix_config: |
experimental-features = nix-command flakes
sandbox = true
sandbox-fallback = false
- name: mach-nix unit tests
run: |
WORKERS=5 nix run .#tests-unit
shell: bash
eval-tests:
name: Eval Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install/Setup - NIX
uses: cachix/install-nix-action@v13
with:
nix_path: nixpkgs=channel:nixos-unstable
install_url: https://releases.nixos.org/nix/nix-2.6.0/install
extra_nix_config: |
experimental-features = nix-command flakes
sandbox = true
sandbox-fallback = false
- name: mach-nix eval tests
run: |
WORKERS=5 nix run .#tests-eval
shell: bash
conda-eval-tests:
name: Eval Tests (with conda)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install/Setup - NIX
uses: cachix/install-nix-action@v13
with:
nix_path: nixpkgs=channel:nixos-unstable
install_url: https://releases.nixos.org/nix/nix-2.6.0/install
extra_nix_config: |
experimental-features = nix-command flakes
sandbox = true
sandbox-fallback = false
- name: mach-nix eval tests
run: |
WORKERS=5 CONDA_TESTS=y nix run .#tests-eval
shell: bash