100 lines
2.6 KiB
YAML
100 lines
2.6 KiB
YAML
|
|
name: "mach-nix CI"
|
|
|
|
on:
|
|
pull_request:
|
|
branches: ["master"]
|
|
push:
|
|
branches: [master, dev, "ci*" ]
|
|
|
|
jobs:
|
|
|
|
pipVersion:
|
|
name: Test Pip version - ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, ]
|
|
python-version: [3.7]
|
|
|
|
## tasks per matrix element
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Install/Setup - PYTHON
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20201221_9fab14a/install
|
|
extra_nix_config: |
|
|
experimental-features = nix-command flakes
|
|
|
|
- name: Install/Setup - NIX
|
|
uses: cachix/install-nix-action@v13
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
- name: PYTHON - Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install flake8 pytest
|
|
|
|
- name: PYTHON - Lint (with flake8) over project files
|
|
run: |
|
|
# stop the build if there are Python syntax errors or undefined names
|
|
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
|
|
- name: pip installation
|
|
run: pip install -e ./
|
|
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
|
|
|
|
|
|
nixVersion:
|
|
name: Test Nix version - ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, ]
|
|
python-version: [3.7]
|
|
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://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20201221_9fab14a/install
|
|
extra_nix_config: |
|
|
experimental-features = nix-command flakes
|
|
|
|
- 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
|
|
|
|
- name: mach-nix evaluation tests
|
|
run: nix run .#tests-all
|
|
|