mach-nix/.github/workflows/CI_NixPy.yml
2020-11-27 13:24:34 +07:00

91 lines
2.1 KiB
YAML

name: "mach-nix CI"
on:
pull_request:
branches: ["master"]
push:
branches: [master, test-ci]
jobs:
pipVersion:
name: Test Pip version - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 5
matrix:
os: [ubuntu-latest, macos-10.14, ]
python-version: [3.7]
## tasks per matrix element
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install/Setup - PYTHON
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install/Setup - NIX
uses: cachix/install-nix-action@v12
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: |
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:
max-parallel: 5
matrix:
os: [ubuntu-latest, macos-10.14, ]
python-version: [3.7]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install/Setup - NIX
uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: nix-env installation
run: nix-env -if . -A mach-nix
shell: bash
- name: cli-test
run: |
mach-nix --version
echo "tensorflow" > reqs.txt
mach-nix env ./env -r reqs.txt
shell: bash