Skip to content

Commit 0754e80

Browse files
committed
test
1 parent a24ddd0 commit 0754e80

File tree

1 file changed

+30
-52
lines changed

1 file changed

+30
-52
lines changed

.github/workflows/check.yml

+30-52
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,38 @@ name: Nix flake check
55
on: push
66

77
jobs:
8-
validate:
9-
runs-on: [self-hosted, nix]
10-
steps:
11-
- uses: actions/checkout@v4
12-
13-
- name: xrefcheck
14-
run: nix run github:serokell/xrefcheck
15-
16-
- name: reuse
17-
run: nix build -L .#checks.x86_64-linux.reuse-lint
18-
# Run step even if the previous one has failed
19-
if: success() || failure()
20-
21-
- name: hlint
22-
run: nix build -L .#checks.x86_64-linux.hlint
23-
if: success() || failure()
24-
25-
- name: stylish-haskell
26-
run: nix build -L .#checks.x86_64-linux.stylish-haskell
27-
if: success() || failure()
28-
29-
- name: check-trailing-whitespace
30-
run: nix build -L .#checks.x86_64-linux.trailing-whitespace
31-
if: success() || failure()
32-
33-
- name: check-hpack
34-
run: nix build -L .#checks.x86_64-linux.hpack
35-
if: success() || failure()
36-
37-
# Export JSON serialized ghc-versions
38-
ghc-versions:
8+
check-outdated:
399
runs-on: [self-hosted, nix]
4010
outputs:
41-
matrix: ${{ steps.set-matrix.outputs.matrix }}
11+
msg: ${{ steps.outdated.outputs.outdated }}
4212
steps:
43-
- uses: actions/checkout@v4
44-
45-
- id: set-matrix
46-
run: echo "matrix=$(nix eval --json .#ghc-matrix.x86_64-linux)" >> $GITHUB_OUTPUT
47-
48-
build-and-test:
49-
needs: ghc-versions
50-
name: ghc${{ matrix.ghc }}
13+
- uses: actions/checkout@v3
14+
15+
- name: check outdated packages
16+
id: outdated
17+
run: |
18+
function output {
19+
echo "outdated<<EOF" >> $GITHUB_OUTPUT
20+
echo "Repository https://github.com/${{ github.repository }} has outdated haskell dependencies" >> $GITHUB_OUTPUT
21+
echo "$msg" >> $GITHUB_OUTPUT
22+
echo "EOF" >> $GITHUB_OUTPUT
23+
}
24+
25+
nix develop .#ci -c cabal update
26+
trap 'output' ERR
27+
msg=$(nix develop .#ci -c cabal outdated --exit-code)
28+
29+
report-outdated:
5130
runs-on: [self-hosted, nix]
52-
strategy:
53-
fail-fast: false
54-
matrix: ${{fromJson(needs.ghc-versions.outputs.matrix)}}
55-
31+
if: failure()
32+
needs: check-outdated
5633
steps:
57-
- uses: actions/checkout@v4
58-
59-
- name: build
60-
run: nix build -L .#checks.x86_64-linux.ghc${{ matrix.ghc }}:build-all --keep-going
61-
62-
- name: test
63-
run: nix build -L .#checks.x86_64-linux.ghc${{ matrix.ghc }}:test-all --keep-going
64-
if: success() || failure()
34+
- name: Report outdated haskell dependencies
35+
env:
36+
MSG: ${{needs.check-outdated.outputs.msg}}
37+
run: |
38+
curl -XPOST https://slack.com/api/chat.postMessage \
39+
-H "Authorization: Bearer ${{ env.SLACK_TOKEN }}" \
40+
# you can change 'libraries' to the channel dedicated to the library, if there is one
41+
-d "channel=libraries" \
42+
-d "text=$MSG"

0 commit comments

Comments
 (0)