mirror of
https://github.com/serokell/haskell-with-utf8.git
synced 2024-09-11 06:45:36 +03:00
test
This commit is contained in:
parent
a24ddd0955
commit
105ad843be
74
.github/workflows/check.yml
vendored
74
.github/workflows/check.yml
vendored
@ -5,60 +5,40 @@ name: Nix flake check
|
|||||||
on: push
|
on: push
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
validate:
|
check-outdated:
|
||||||
runs-on: [self-hosted, nix]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: xrefcheck
|
|
||||||
run: nix run github:serokell/xrefcheck
|
|
||||||
|
|
||||||
- name: reuse
|
|
||||||
run: nix build -L .#checks.x86_64-linux.reuse-lint
|
|
||||||
# Run step even if the previous one has failed
|
|
||||||
if: success() || failure()
|
|
||||||
|
|
||||||
- name: hlint
|
|
||||||
run: nix build -L .#checks.x86_64-linux.hlint
|
|
||||||
if: success() || failure()
|
|
||||||
|
|
||||||
- name: stylish-haskell
|
|
||||||
run: nix build -L .#checks.x86_64-linux.stylish-haskell
|
|
||||||
if: success() || failure()
|
|
||||||
|
|
||||||
- name: check-trailing-whitespace
|
|
||||||
run: nix build -L .#checks.x86_64-linux.trailing-whitespace
|
|
||||||
if: success() || failure()
|
|
||||||
|
|
||||||
- name: check-hpack
|
|
||||||
run: nix build -L .#checks.x86_64-linux.hpack
|
|
||||||
if: success() || failure()
|
|
||||||
|
|
||||||
# Export JSON serialized ghc-versions
|
|
||||||
ghc-versions:
|
|
||||||
runs-on: [self-hosted, nix]
|
runs-on: [self-hosted, nix]
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
msg: ${{ steps.outdated.outputs.outdated }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- id: set-matrix
|
- name: check outdated packages
|
||||||
run: echo "matrix=$(nix eval --json .#ghc-matrix.x86_64-linux)" >> $GITHUB_OUTPUT
|
id: outdated
|
||||||
|
run: |
|
||||||
|
function output {
|
||||||
|
echo "outdated<<EOF" >> $GITHUB_OUTPUT
|
||||||
|
echo "Repository https://github.com/${{ github.repository }} has outdated haskell dependencies" >> $GITHUB_OUTPUT
|
||||||
|
echo "$msg" >> $GITHUB_OUTPUT
|
||||||
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
}
|
||||||
|
|
||||||
build-and-test:
|
nix develop .#ci -c cabal update
|
||||||
needs: ghc-versions
|
trap 'output' ERR
|
||||||
name: ghc${{ matrix.ghc }}
|
msg=$(nix develop .#ci -c cabal outdated --exit-code)
|
||||||
|
|
||||||
|
report-outdated:
|
||||||
runs-on: [self-hosted, nix]
|
runs-on: [self-hosted, nix]
|
||||||
strategy:
|
if: failure()
|
||||||
fail-fast: false
|
needs: check-outdated
|
||||||
matrix: ${{fromJson(needs.ghc-versions.outputs.matrix)}}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: build
|
- name: Report outdated haskell dependencies
|
||||||
run: nix build -L .#checks.x86_64-linux.ghc${{ matrix.ghc }}:build-all --keep-going
|
env:
|
||||||
|
MSG: ${{needs.check-outdated.outputs.msg}}
|
||||||
- name: test
|
run: |
|
||||||
run: nix build -L .#checks.x86_64-linux.ghc${{ matrix.ghc }}:test-all --keep-going
|
# you can change 'libraries' to the channel dedicated to the library, if there is one
|
||||||
if: success() || failure()
|
nix develop .#ci -c curl -XPOST https://slack.com/api/chat.postMessage \
|
||||||
|
-H "Authorization: Bearer ${{ env.SLACK_TOKEN }}" \
|
||||||
|
-d "channel=libraries" \
|
||||||
|
-d "text=$MSG"
|
||||||
|
@ -93,7 +93,10 @@
|
|||||||
legacyPackages = pkgs;
|
legacyPackages = pkgs;
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
buildInputs = [ pkgs.hpack ];
|
buildInputs = [ pkgs.hpack pkgs.curl ];
|
||||||
|
};
|
||||||
|
devShells.ci = pkgs.mkShell {
|
||||||
|
buildInputs = [ pkgs.cabal-install pkgs.ghc pkgs.curl ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# used to dynamically build a matrix in the GitHub pipeline
|
# used to dynamically build a matrix in the GitHub pipeline
|
||||||
|
Loading…
Reference in New Issue
Block a user