poetry2nix/.github/workflows/ci.yml

76 lines
2.6 KiB
YAML
Raw Permalink Normal View History

2020-04-08 16:39:06 +12:00
name: CI
on:
pull_request:
jobs:
2020-04-15 14:21:28 +01:00
nixpkgs-fmt:
runs-on: ubuntu-latest
steps:
2021-12-30 07:24:08 -05:00
- uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-unstable
2021-11-04 12:53:38 -07:00
- uses: actions/checkout@v2.4.0
2020-04-15 14:21:28 +01:00
- name: Check format
run: nix-shell --arg packages 'pkgs:[ pkgs.nixpkgs-fmt ]' --run 'nixpkgs-fmt --check .'
2020-04-15 14:21:28 +01:00
2022-01-12 18:47:38 +13:00
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
- uses: cachix/cachix-action@v10
with:
name: poetry2nix
signingKey: "VhaWuN3IyJVpWg+aZvTocVB+W8ziZKKRGLKR53Pkld3YRZxYOUfXZf0fvqF+LkqVW0eA60trVd5vsqNONpX9Hw=="
2022-01-12 18:47:38 +13:00
- 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'
2022-01-12 18:47:38 +13:00
2022-01-12 18:47:49 +13:00
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
- uses: cachix/cachix-action@v10
with:
name: poetry2nix
signingKey: "VhaWuN3IyJVpWg+aZvTocVB+W8ziZKKRGLKR53Pkld3YRZxYOUfXZf0fvqF+LkqVW0eA60trVd5vsqNONpX9Hw=="
2022-01-12 18:47:49 +13:00
- name: Check format
run: nix-shell --arg packages 'pkgs:[ pkgs.p2nix-tools.env ]' --run 'black --check .'
2022-01-12 18:47:49 +13:00
matrix_generate:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2.4.0
2021-12-30 07:24:08 -05:00
- uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-unstable
- id: set-matrix
2021-12-30 07:23:53 -05:00
run: |
set -euo pipefail
2022-01-21 15:33:06 +12:00
matrix="$(nix-instantiate --eval --json --expr 'builtins.attrNames (import ./tests {})' | jq -rcM '{attr: ., os: ["ubuntu-latest", "macos-latest"]}')"
2021-12-30 07:23:53 -05:00
echo "::set-output name=matrix::$matrix"
builds:
needs: matrix_generate
2022-01-21 15:33:06 +12:00
runs-on: ${{ matrix.os }}
2020-04-08 16:39:06 +12:00
strategy:
matrix: ${{fromJSON(needs.matrix_generate.outputs.matrix)}}
2020-04-08 16:39:06 +12:00
steps:
- uses: actions/checkout@v2.4.0
2021-12-30 07:24:08 -05:00
- uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
with:
name: poetry2nix
signingKey: "VhaWuN3IyJVpWg+aZvTocVB+W8ziZKKRGLKR53Pkld3YRZxYOUfXZf0fvqF+LkqVW0eA60trVd5vsqNONpX9Hw=="
- run: nix-shell --arg packages 'pkgs:[ pkgs.nix-build-uncached ]' --run 'nix-build-uncached -build-flags "-L" --keep-going --show-trace tests/default.nix -A ${{ matrix.attr }}'