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
|
2021-08-11 18:11:38 -05:00
|
|
|
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: ./check-fmt
|
|
|
|
|
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
|
|
|
|
- name: Check format
|
2022-05-10 07:43:01 +12:00
|
|
|
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
|
|
|
|
- name: Check format
|
|
|
|
run: nix-shell --run 'black --check .'
|
|
|
|
|
2021-12-25 21:10:37 -08: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
|
2021-12-25 21:10:37 -08:00
|
|
|
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"
|
2021-12-25 21:10:37 -08:00
|
|
|
|
|
|
|
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:
|
2021-12-25 21:10:37 -08:00
|
|
|
matrix: ${{fromJSON(needs.matrix_generate.outputs.matrix)}}
|
2020-04-08 16:39:06 +12:00
|
|
|
steps:
|
2021-12-25 21:10:37 -08:00
|
|
|
- uses: actions/checkout@v2.4.0
|
2021-12-30 07:24:08 -05:00
|
|
|
- uses: cachix/install-nix-action@v16
|
2021-12-25 21:10:37 -08:00
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
- uses: cachix/cachix-action@v10
|
|
|
|
with:
|
|
|
|
name: poetry2nix
|
|
|
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
2022-01-21 17:49:19 +12:00
|
|
|
- run: nix-shell --run 'nix-build-uncached -build-flags "-L" --keep-going --show-trace tests/default.nix -A ${{ matrix.attr }}'
|