2020-07-24 10:16:51 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2022-05-20 06:48:28 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2020-07-24 10:16:51 +00:00
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
nixpkgs-fmt:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"
|
|
|
|
steps:
|
|
|
|
- uses: cachix/install-nix-action@v12
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Check format
|
2022-05-28 19:23:13 +00:00
|
|
|
run: nix-shell --run 'nixpkgs-fmt --check .'
|
2020-07-24 10:16:51 +00:00
|
|
|
|
2022-05-29 07:52:59 +00:00
|
|
|
gomod2nix_toml:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"
|
|
|
|
steps:
|
|
|
|
- uses: cachix/install-nix-action@v12
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: "Build gomod2nix"
|
|
|
|
run: nix-shell --run "go build"
|
|
|
|
- name: Run gomod2nix
|
|
|
|
run: nix-shell --run gomod2nix
|
|
|
|
- name: Check diff
|
|
|
|
run: git diff --exit-code gomod2nix.toml
|
|
|
|
|
2022-05-29 07:39:36 +00:00
|
|
|
list-jobs:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: cachix/install-nix-action@v17
|
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
- id: set-matrix
|
|
|
|
run: |
|
|
|
|
set -euo pipefail
|
|
|
|
matrix="$(go run tests/run.go list | jq --raw-input --slurp -rcM '{attr: split("\n")[:-1], os: ["ubuntu-latest"]}')"
|
|
|
|
echo "::set-output name=matrix::$matrix"
|
|
|
|
|
|
|
|
builds:
|
|
|
|
needs: list-jobs
|
2020-07-24 10:16:51 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
2022-05-29 07:39:36 +00:00
|
|
|
matrix: ${{fromJSON(needs.list-jobs.outputs.matrix)}}
|
2020-07-24 10:16:51 +00:00
|
|
|
steps:
|
2022-05-29 07:39:36 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: cachix/install-nix-action@v17
|
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
- name: "Build gomod2nix"
|
|
|
|
run: nix-shell --run "go build"
|
|
|
|
- name: "Run test: ${{ matrix.attr }}"
|
|
|
|
run: nix-shell --run "go run tests/run.go run ${{ matrix.attr }}"
|