diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..6cdad06 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,71 @@ +name: ci + +on: + push: + branches: + - main + + pull_request: + branches: + - main + + workflow_dispatch: + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - "macos-latest" + - "ubuntu-latest" + app: + - name: "cabal-fmt" + cmd: "nix run .#cabal-fmt -- --help" + - name: "fourmolu" + cmd: "nix run .#fourmolu -- --help" + - name: "hlint" + cmd: "nix run .#hlint -- --help" + - name: "haddock coverage" + cmd: "nix run .#haddock-cov -- --nh-help" + - name: "nixpkgs-fmt" + cmd: "nix run .#nixpkgs-fmt" + - name: "ormolu" + cmd: "nix run .#ormolu -- --help" + - name: "stylish" + cmd: "nix run .#stylish -- --help" + - name: "help" + cmd: "nix run .#help" + - name: "version" + cmd: "nix run .#version" + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + + - name: Setup nix + uses: cachix/install-nix-action@v22 + with: + nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/b39924fc7764c08ae3b51beef9a3518c414cdb7d.tar.gz + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + + - name: Check + run: nix flake check + + - name: Test ${{ matrix.app.name }} + run: ${{ matrix.app.cmd }} + + style: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup nix + uses: cachix/install-nix-action@v22 + with: + nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/b39924fc7764c08ae3b51beef9a3518c414cdb7d.tar.gz + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + + - name: nixpkgs-fmt + run: nix run .#nixpkgs-fmt -- --check diff --git a/.github/workflows/nix.yaml b/.github/workflows/nix.yaml deleted file mode 100644 index af6ebd7..0000000 --- a/.github/workflows/nix.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: nix - -on: - push: - branches: - - main - - pull_request: - branches: - - main - - workflow_dispatch: - -jobs: - nix: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.0.2 - - - name: Setup nix - uses: cachix/install-nix-action@v17 - with: - nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/b39924fc7764c08ae3b51beef9a3518c414cdb7d.tar.gz - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - - name: Check - run: nix flake check - - - name: Test cabal-fmt - run: nix run .#cabal-fmt -- --help - - - name: Test fourmolu - run: nix run .#fourmolu -- --help - - - name: Test hlint - run: nix run .#hlint -- --help - - - name: Test haddock coverage - run: nix run .#haddock-cov -- --nh-help - - # for some reason, 'nix run .#nixpkgs-fmt -- --help' dies on ci - - name: Test nixpkgs-fmt - run: nix run .#nixpkgs-fmt - - - name: Test ormolu - run: nix run .#ormolu -- --help - - - name: Test stylish - run: nix run .#stylish -- --help - - - name: Test help - run: nix run .#help - - - name: Test version - run: nix run .#version diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml deleted file mode 100644 index 4753fa7..0000000 --- a/.github/workflows/style.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: style - -on: - push: - branches: - - main - - pull_request: - branches: - - main - - workflow_dispatch: - -jobs: - check-style: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.0.2 - - - name: Setup nix - uses: cachix/install-nix-action@v17 - with: - nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/b39924fc7764c08ae3b51beef9a3518c414cdb7d.tar.gz - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - - name: nixpkgs-fmt - run: nix run .#nixpkgs-fmt -- --check \ No newline at end of file diff --git a/README.md b/README.md index 24cfe35..9b10e2a 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ [![GitHub release (latest SemVer)](https://img.shields.io/github/v/tag/tbidne/nix-hs-tools?include_prereleases&sort=semver)](https://github.com/tbidne/nix-hs-tools/releases/) ![haskell](https://img.shields.io/static/v1?label=&message=9.4&logo=haskell&logoColor=655889&labelColor=2f353e&color=655889) -[![nix](http://img.shields.io/github/actions/workflow/status/tbidne/nix-hs-tools/nix.yaml?branch=main&label=nix&logo=nixos&logoColor=85c5e7&labelColor=2f353c)](https://github.com/tbidne/nix-hs-tools/actions/workflows/nix.yaml) -[![style](http://img.shields.io/github/actions/workflow/status/tbidne/nix-hs-tools/style.yaml?branch=main&label=style&logoColor=white&labelColor=2f353c)](https://github.com/tbidne/nix-hs-tools/actions/workflows/style.yaml) +[![ci](http://img.shields.io/github/actions/workflow/status/tbidne/nix-hs-tools/ci.yaml?branch=main&logoColor=85c5e7&labelColor=2f353c)](https://github.com/tbidne/nix-hs-tools/actions/workflows/ci.yaml) [![MIT](https://img.shields.io/github/license/tbidne/nix-hs-tools?color=blue)](https://opensource.org/licenses/MIT) ### Haskell development tools by Nix