mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-05 09:11:39 -05:00
67 lines
2 KiB
YAML
67 lines
2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
nixpkgs-fmt:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: cachix/install-nix-action@v16
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
- uses: actions/checkout@v2.4.0
|
|
- name: Check format
|
|
run: ./check-fmt
|
|
|
|
py2-compat:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: cachix/install-nix-action@v16
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
- uses: actions/checkout@v2.4.0
|
|
- name: Check format
|
|
run: nix-shell --arg packages 'pkgs: [ pkgs.p2nix-tools.py2-astparse ]' --run 'git ls-files | grep -Pv "^tools" | grep -P "\.py$" | xargs py2-astparse'
|
|
|
|
black-fmt:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: cachix/install-nix-action@v16
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
- uses: actions/checkout@v2.4.0
|
|
- name: Check format
|
|
run: nix-shell --run 'black --check .'
|
|
|
|
matrix_generate:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
- uses: cachix/install-nix-action@v16
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
- id: set-matrix
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
matrix="$(nix-instantiate --eval --json --expr 'builtins.attrNames (import ./tests {})' | jq -rcM '{attr: ., os: ["ubuntu-latest", "macos-latest"]}')"
|
|
echo "::set-output name=matrix::$matrix"
|
|
|
|
builds:
|
|
needs: matrix_generate
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix: ${{fromJSON(needs.matrix_generate.outputs.matrix)}}
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
- uses: cachix/install-nix-action@v16
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
- uses: cachix/cachix-action@v10
|
|
with:
|
|
name: poetry2nix
|
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
|
- run: nix-shell --run 'nix-build-uncached -build-flags "-L" --keep-going --show-trace tests/default.nix -A ${{ matrix.attr }}'
|