Skip to content

Commit b354202

Browse files
CI: linting (#2538)
* CI: {caching,test,bench}: paths layout * CI: nix: paths layout * CI: build: organize step names * CI: build: organize step names
1 parent 3e17c4f commit b354202

File tree

5 files changed

+99
-28
lines changed

5 files changed

+99
-28
lines changed

.github/workflows/bench.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,18 @@ jobs:
2424
uses: fkirc/[email protected]
2525
with:
2626
cancel_others: false
27-
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "**.nix", "**/test/**", "flake.lock", "**/README.md", "FUNDING.yml", "**/stack*.yaml"]'
27+
paths_ignore: '[ "**/docs/**"
28+
, "**.md"
29+
, "**/LICENSE"
30+
, ".circleci/**"
31+
, "install/**"
32+
, "**.nix"
33+
, "**/test/**"
34+
, "flake.lock"
35+
, "**/README.md"
36+
, "FUNDING.yml"
37+
, "**/stack*.yaml"
38+
]'
2839

2940
bench_init:
3041
if: needs.pre_job.outputs.should_skip != 'true'

.github/workflows/build.yml

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,17 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
ghc: ['9.0.1', '8.10.7', '8.10.6', '8.8.4', '8.6.5']
22-
os: [ubuntu-18.04, macOS-latest, windows-latest]
21+
ghc:
22+
[ "9.0.1"
23+
, '8.10.7'
24+
, "8.10.6"
25+
, "8.8.4"
26+
, "8.6.5"
27+
]
28+
os: [ "ubuntu-18.04"
29+
, "macOS-latest"
30+
, "windows-latest"
31+
]
2332
cabal: ['3.6']
2433

2534
steps:
@@ -44,7 +53,7 @@ jobs:
4453
echo -e 'package blaze-textual\n flags: +integer-simple' >> cabal.project.local
4554
fi
4655
47-
- name: Use modified cabal.project for ghc9
56+
- name: (GHC 9.0) Use modified cabal.project for GHC 9.0
4857
if: ${{ matrix.ghc == '9.0.1' }}
4958
run: cp cabal-ghc901.project cabal.project
5059

@@ -56,36 +65,36 @@ jobs:
5665
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
5766
src/**/*.hs exe/*.hs
5867
59-
- name: Set some window specific things
68+
- name: (Windows) Platform specifics
6069
if: matrix.os == 'windows-latest'
6170
env:
6271
GHC_VER: ${{ matrix.ghc }}
6372
run: |
6473
echo "EXE_EXT=.exe" >> $GITHUB_ENV
6574
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
6675
67-
- name: Set some linux specific things
76+
- name: (Linux) Platform specifics
6877
if: matrix.os == 'ubuntu-18.04'
6978
env:
7079
GHC_VER: ${{ matrix.ghc }}
7180
run: |
7281
echo "LINUX_CABAL_ARGS=--enable-executable-static --ghc-options=-split-sections" >> $GITHUB_ENV
7382
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
7483
75-
- name: Set some macOs specific things
84+
- name: (macOS) Platform specifics
7685
if: matrix.os == 'macOS-latest'
7786
env:
7887
GHC_VER: ${{ matrix.ghc }}
7988
run: |
8089
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
8190
82-
- name: Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows
91+
- name: (Windows, GHC 8.8.4) Workaround segfaults
8392
if: matrix.ghc == '8.8.4' && matrix.os == 'windows-latest'
8493
run: |
8594
echo "package floskell" >> cabal.project
8695
echo " ghc-options: -O0" >> cabal.project
8796
88-
- name: Build server
97+
- name: Build the server
8998
# Try building it twice in case of flakey builds on Windows
9099
run: |
91100
cabal build --disable-tests exe:hls -O2 $LINUX_CABAL_ARGS || \
@@ -109,7 +118,7 @@ jobs:
109118
echo ::set-output name=extension::gz
110119
fi
111120
112-
- name: Upload server to release
121+
- name: (not check) Upload server to release
113122
if: ${{ !contains(github.ref_name, 'check') }}
114123
uses: actions/[email protected]
115124
env:
@@ -126,11 +135,11 @@ jobs:
126135
name: haskell-language-server-${{ runner.OS }}-${{ matrix.ghc }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }}
127136
path: ${{ steps.compress_server_binary.outputs.path }}
128137

129-
- name: Build wrapper
138+
- name: (GHC 8.10) Build the wrapper
130139
if: matrix.ghc == '8.10.7'
131140
run: cabal build --disable-tests exe:hls-wrapper -O2 $LINUX_CABAL_ARGS
132141

133-
- name: Compress wrapper binary
142+
- name: (GHC 8.10) Compress wrapper binary
134143
if: matrix.ghc == '8.10.7'
135144
id: compress_wrapper_binary
136145
run: |
@@ -149,7 +158,7 @@ jobs:
149158
echo ::set-output name=extension::gz
150159
fi
151160
152-
- name: Upload wrapper to the release
161+
- name: (GHC 8.10, not check) Upload wrapper to the release
153162
if: ${{ matrix.ghc == '8.10.7' && !contains(github.ref_name, 'check') }}
154163
uses: actions/[email protected]
155164
env:
@@ -160,7 +169,7 @@ jobs:
160169
asset_name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }}
161170
asset_content_type: ${{ steps.compress_wrapper_binary.outputs.content_type}}
162171

163-
- name: Upload wrapper to workflow artifacts
172+
- name: (GHC 8.10) Upload wrapper to workflow artifacts
164173
uses: actions/upload-artifact@v2
165174
if: matrix.ghc == '8.10.7'
166175
with:
@@ -183,7 +192,7 @@ jobs:
183192
-o src-dist/haskell-language-server.tar.gz \
184193
HEAD
185194
186-
- name: Upload source tarball to the release
195+
- name: (not check) Upload source tarball to the release
187196
if: ${{ !contains(github.ref_name, 'check') }}
188197
uses: actions/[email protected]
189198
env:
@@ -207,7 +216,10 @@ jobs:
207216
runs-on: ubuntu-18.04
208217
strategy:
209218
matrix:
210-
os: [Linux, macOS, Windows]
219+
os: [ "Linux"
220+
, "macOS"
221+
, "Windows"
222+
]
211223
steps:
212224
- uses: actions/download-artifact@v2
213225

@@ -227,7 +239,7 @@ jobs:
227239
fi
228240
tar -czpf haskell-language-server.tar.gz *
229241
230-
- name: Upload binaries tarball to the release
242+
- name: (not check) Upload binaries tarball to the release
231243
if: ${{ !contains(github.ref_name, 'check') }}
232244
uses: actions/[email protected]
233245
env:
@@ -256,7 +268,7 @@ jobs:
256268
# we clean up tags to match the release file names
257269
sed -i 's/\/.*)/)/g' SHA256SUMS
258270
259-
- name: Upload sha256sums to the release
271+
- name: (not check) Upload sha256sums to the release
260272
if: ${{ !contains(github.ref_name, 'check') }}
261273
uses: actions/[email protected]
262274
env:

.github/workflows/caching.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,16 @@ jobs:
5858
uses: fkirc/[email protected]
5959
with:
6060
cancel_others: false
61-
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", "install/**", "**.nix", "flake.lock", "**/README.md", "FUNDING.yml", ".circleci/**"]'
61+
paths_ignore: '["**/docs/**"
62+
, "**.md"
63+
, "**/LICENSE"
64+
, "install/**"
65+
, "**.nix"
66+
, "flake.lock"
67+
, "**/README.md"
68+
, "FUNDING.yml"
69+
, ".circleci/**"
70+
]'
6271

6372
caching:
6473
if: needs.pre_job.outputs.should_skip != 'true'
@@ -67,8 +76,16 @@ jobs:
6776
strategy:
6877
fail-fast: false
6978
matrix:
70-
ghc: ["9.0.1", '8.10.7', '8.10.6', "8.8.4", "8.6.5"]
71-
os: [ubuntu-latest, macOS-latest, windows-latest]
79+
ghc: [ "9.0.1"
80+
, "8.10.7"
81+
, "8.10.6"
82+
, "8.8.4"
83+
, "8.6.5"
84+
]
85+
os: [ "ubuntu-latest"
86+
, "macOS-latest"
87+
, "windows-latest"
88+
]
7289
cabal: ['3.6']
7390

7491
steps:

.github/workflows/nix.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,20 @@ jobs:
2424
uses: fkirc/[email protected]
2525
with:
2626
cancel_others: false
27-
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "**/README.md", "FUNDING.yml", "**/stack*.yaml"]'
27+
paths_ignore: '[ "**/docs/**"
28+
, "**.md"
29+
, "**/LICENSE"
30+
, ".circleci/**"
31+
, "install/**"
32+
, "**/README.md"
33+
, "FUNDING.yml"
34+
, "**/stack*.yaml"
35+
]'
2836
- id: skip_check_no_nix
2937
uses: fkirc/[email protected]
3038
with:
3139
cancel_others: false
32-
paths: '["**.nix"]'
40+
paths: '[ "**.nix" ]'
3341

3442
# Enter the development shell and run `cabal build`
3543
develop:

.github/workflows/test.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,29 @@ jobs:
2525
uses: fkirc/[email protected]
2626
with:
2727
cancel_others: false
28-
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", "install/**", "**.nix", "flake.lock", "**/README.md", "FUNDING.yml", ".circleci/**", "**/stack*.yaml"]'
28+
paths_ignore: '[ "**/docs/**"
29+
, "**.md"
30+
, "**/LICENSE"
31+
, "install/**"
32+
, "**.nix"
33+
, "flake.lock"
34+
, "**/README.md"
35+
, "FUNDING.yml"
36+
, ".circleci/**"
37+
, "**/stack*.yaml"
38+
]'
2939
# If we only change ghcide downstream packages we have not test ghcide itself
3040
- id: skip_ghcide_check
3141
uses: fkirc/[email protected]
3242
with:
3343
cancel_others: false
34-
paths_ignore: '["hls-test-utils/**", "plugins/**", "src/**", "exe/**", "test/**", "shake-bench/**"]'
44+
paths_ignore: '[ "hls-test-utils/**"
45+
, "plugins/**"
46+
, "src/**"
47+
, "exe/**"
48+
, "test/**"
49+
, "shake-bench/**"
50+
]'
3551

3652
test:
3753
if: needs.pre_job.outputs.should_skip != 'true'
@@ -40,8 +56,15 @@ jobs:
4056
strategy:
4157
fail-fast: true
4258
matrix:
43-
ghc: ["9.0.1", '8.10.7', '8.10.6', "8.8.4", "8.6.5"]
44-
os: [ubuntu-latest, macOS-latest]
59+
ghc: [ "9.0.1"
60+
, "8.10.7"
61+
, "8.10.6"
62+
, "8.8.4"
63+
, "8.6.5"
64+
]
65+
os: [ "ubuntu-latest"
66+
, "macOS-latest"
67+
]
4568
cabal: ['3.6']
4669
include:
4770
# only test supported ghc major versions
@@ -93,7 +116,7 @@ jobs:
93116
94117
# Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file
95118
- if: matrix.ghc == '9.0.1'
96-
name: (GHC 9.0.1) Use modified `cabal.project`
119+
name: (GHC 9.0) Use modified `cabal.project`
97120
run: |
98121
# File has some protections preventing regular `rm`.
99122
# (most probably sticky bit is set on $HOME)

0 commit comments

Comments
 (0)