Skip to content

Commit 8444e53

Browse files
committed
CI: (caching,test,bench): org bootstrap
This were organized but others were ommited, because `build` & `hackage` have a different purpose I postphoned addind bootstrap to them.
1 parent b06ca9c commit 8444e53

File tree

3 files changed

+116
-41
lines changed

3 files changed

+116
-41
lines changed

.github/workflows/bench.yml

+69
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636

3737
steps:
3838
- uses: actions/checkout@v2
39+
with:
40+
submodules: true
3941

4042
- run: git fetch origin master # check the master branch for benchmarking
4143

@@ -45,6 +47,39 @@ jobs:
4547
cabal-version: ${{ matrix.cabal }}
4648
enable-stack: false
4749

50+
- if: runner.os == 'Windows'
51+
name: (Windows) Platform config
52+
run: |
53+
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
54+
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
55+
- if: ( runner.os == 'Linux' ) || ( runner.os == 'macOS' )
56+
name: (Linux,macOS) Platform config
57+
run: |
58+
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
59+
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
60+
61+
# Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file
62+
- if: matrix.ghc == '9.0.1'
63+
name: (GHC 9.0.1) Use modified `cabal.project`
64+
run: |
65+
cp cabal-ghc901.project cabal.project
66+
- if: runner.os == 'Windows' && matrix.ghc == '8.8.4'
67+
name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults
68+
run: |
69+
echo "package floskell" >> cabal.project
70+
echo " ghc-options: -O0" >> cabal.project
71+
72+
# Shorten binary names as a workaround for filepath length limits in Windows,
73+
# but since tests are hardcoded on this workaround -
74+
# all platforms (in 2021-12-07) need it.
75+
- name: Workaround shorten binary names
76+
run: |
77+
sed -i.bak -e 's/haskell-language-server/hls/g' \
78+
-e 's/haskell_language_server/hls/g' \
79+
haskell-language-server.cabal cabal.project
80+
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
81+
src/**/*.hs exe/*.hs
82+
4883
- name: Cache Cabal
4984
uses: actions/cache@v2
5085
with:
@@ -105,6 +140,7 @@ jobs:
105140
matrix:
106141
ghc: ['8.10.7']
107142
os: [ubuntu-latest]
143+
cabal: ['3.6']
108144
example: ['cabal', 'lsp-types']
109145

110146
steps:
@@ -114,6 +150,39 @@ jobs:
114150
cabal-version: ${{ matrix.cabal }}
115151
enable-stack: false
116152

153+
- if: runner.os == 'Windows'
154+
name: (Windows) Platform config
155+
run: |
156+
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
157+
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
158+
- if: ( runner.os == 'Linux' ) || ( runner.os == 'macOS' )
159+
name: (Linux,macOS) Platform config
160+
run: |
161+
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
162+
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
163+
164+
# Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file
165+
- if: matrix.ghc == '9.0.1'
166+
name: (GHC 9.0.1) Use modified `cabal.project`
167+
run: |
168+
cp cabal-ghc901.project cabal.project
169+
- if: runner.os == 'Windows' && matrix.ghc == '8.8.4'
170+
name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults
171+
run: |
172+
echo "package floskell" >> cabal.project
173+
echo " ghc-options: -O0" >> cabal.project
174+
175+
# Shorten binary names as a workaround for filepath length limits in Windows,
176+
# but since tests are hardcoded on this workaround -
177+
# all platforms (in 2021-12-07) need it.
178+
- name: Workaround shorten binary names
179+
run: |
180+
sed -i.bak -e 's/haskell-language-server/hls/g' \
181+
-e 's/haskell_language_server/hls/g' \
182+
haskell-language-server.cabal cabal.project
183+
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
184+
src/**/*.hs exe/*.hs
185+
117186
- name: Download cabal home
118187
uses: actions/download-artifact@v2
119188
with:

.github/workflows/caching.yml

+24-21
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
- '**'
2323

2424
jobs:
25+
2526
pre_job:
2627
runs-on: ubuntu-latest
2728
outputs:
@@ -40,7 +41,7 @@ jobs:
4041
cancel_others: false
4142
paths_ignore: '["hls-test-utils/**", "plugins/**", "src/**", "exe/**", "test/**", "shake-bench/**"]'
4243

43-
deps:
44+
caching:
4445
if: needs.pre_job.outputs.should_skip != 'true'
4546
needs: pre_job
4647
runs-on: ${{ matrix.os }}
@@ -58,34 +59,45 @@ jobs:
5859
- uses: actions/checkout@v2
5960
with:
6061
submodules: true
62+
6163
- uses: haskell/actions/setup@v1
6264
with:
63-
ghc-version : ${{ matrix.ghc }}
65+
ghc-version: ${{ matrix.ghc }}
6466
cabal-version: ${{ matrix.cabal }}
6567

66-
- if: matrix.os == 'windows-latest'
67-
name: Set some window specific things
68+
- if: runner.os == 'Windows'
69+
name: (Windows) Platform config
6870
run: |
6971
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
7072
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
71-
72-
- if: matrix.os != 'windows-latest'
73-
name: Set some linux/macOS specific things
73+
- if: ( runner.os == 'Linux' ) || ( runner.os == 'macOS' )
74+
name: (Linux,macOS) Platform config
7475
run: |
7576
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
7677
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
7778
7879
# Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file
7980
- if: matrix.ghc == '9.0.1'
80-
name: Use modified cabal.project for ghc9
81-
run: cp cabal-ghc901.project cabal.project
82-
83-
- if: matrix.ghc == '8.8.4' && matrix.os == 'windows-latest'
84-
name: Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows
81+
name: (GHC 9.0.1) Use modified `cabal.project`
82+
run: |
83+
cp cabal-ghc901.project cabal.project
84+
- if: runner.os == 'Windows' && matrix.ghc == '8.8.4'
85+
name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults
8586
run: |
8687
echo "package floskell" >> cabal.project
8788
echo " ghc-options: -O0" >> cabal.project
8889
90+
# Shorten binary names as a workaround for filepath length limits in Windows,
91+
# but since tests are hardcoded on this workaround -
92+
# all platforms (in 2021-12-07) need it.
93+
- name: Workaround shorten binary names
94+
run: |
95+
sed -i.bak -e 's/haskell-language-server/hls/g' \
96+
-e 's/haskell_language_server/hls/g' \
97+
haskell-language-server.cabal cabal.project
98+
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
99+
src/**/*.hs exe/*.hs
100+
89101
- name: Cache Cabal
90102
uses: actions/cache@v2
91103
env:
@@ -102,15 +114,6 @@ jobs:
102114
103115
- run: cabal update
104116

105-
# Need this to work around filepath length limits in Windows
106-
- name: Shorten binary names
107-
run: |
108-
sed -i.bak -e 's/haskell-language-server/hls/g' \
109-
-e 's/haskell_language_server/hls/g' \
110-
haskell-language-server.cabal cabal.project
111-
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
112-
src/**/*.hs exe/*.hs
113-
114117
# repeating builds to workaround segfaults in windows and ghc-8.8.4
115118
- name: Build
116119
run: cabal build --only-dependencies || cabal build --only-dependencies || cabal build --only-dependencies

.github/workflows/test.yml

+23-20
Original file line numberDiff line numberDiff line change
@@ -76,37 +76,45 @@ jobs:
7676
- uses: actions/checkout@v2
7777
with:
7878
submodules: true
79+
7980
- uses: haskell/actions/setup@v1
8081
with:
8182
ghc-version : ${{ matrix.ghc }}
8283
cabal-version: ${{ matrix.cabal }}
8384

84-
- run: ./fmt.sh
85-
name: "HLint via ./fmt.sh"
86-
87-
- if: matrix.os == 'windows-latest'
88-
name: Set some window specific things
85+
- if: runner.os == 'Windows'
86+
name: (Windows) Platform config
8987
run: |
9088
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
9189
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
92-
93-
- if: matrix.os != 'windows-latest'
94-
name: Set some linux/macOS specific things
90+
- if: ( runner.os == 'Linux' ) || ( runner.os == 'macOS' )
91+
name: (Linux,macOS) Platform config
9592
run: |
9693
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
9794
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
9895
9996
# Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file
10097
- if: matrix.ghc == '9.0.1'
101-
name: Use modified cabal.project for ghc9
102-
run: cp cabal-ghc901.project cabal.project
103-
104-
- if: matrix.ghc == '8.8.4' && matrix.os == 'windows-latest'
105-
name: Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows
98+
name: (GHC 9.0.1) Use modified `cabal.project`
99+
run: |
100+
cp cabal-ghc901.project cabal.project
101+
- if: runner.os == 'Windows' && matrix.ghc == '8.8.4'
102+
name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults
106103
run: |
107104
echo "package floskell" >> cabal.project
108105
echo " ghc-options: -O0" >> cabal.project
109106
107+
# Shorten binary names as a workaround for filepath length limits in Windows,
108+
# but since tests are hardcoded on this workaround -
109+
# all platforms (in 2021-12-07) need it.
110+
- name: Workaround shorten binary names
111+
run: |
112+
sed -i.bak -e 's/haskell-language-server/hls/g' \
113+
-e 's/haskell_language_server/hls/g' \
114+
haskell-language-server.cabal cabal.project
115+
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
116+
src/**/*.hs exe/*.hs
117+
110118
- name: Cache Cabal
111119
uses: actions/cache@v2
112120
env:
@@ -123,14 +131,9 @@ jobs:
123131
124132
- run: cabal update
125133

126-
# Need this to work around filepath length limits in Windows
127-
- name: Shorten binary names
134+
- name: "HLint via ./fmt.sh"
128135
run: |
129-
sed -i.bak -e 's/haskell-language-server/hls/g' \
130-
-e 's/haskell_language_server/hls/g' \
131-
haskell-language-server.cabal cabal.project
132-
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
133-
src/**/*.hs exe/*.hs
136+
./fmt.sh
134137
135138
# repeating builds to workaround segfaults in windows and ghc-8.8.4
136139
- name: Build

0 commit comments

Comments
 (0)