@@ -5,60 +5,38 @@ name: Nix flake check
5
5
on : push
6
6
7
7
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 :
39
9
runs-on : [self-hosted, nix]
40
10
outputs :
41
- matrix : ${{ steps.set-matrix .outputs.matrix }}
11
+ msg : ${{ steps.outdated .outputs.outdated }}
42
12
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 :
51
30
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
56
33
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