Skip to content

Commit c5d055d

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 8d887c4 commit c5d055d

File tree

3 files changed

+83
-41
lines changed

3 files changed

+83
-41
lines changed

.github/workflows/bench.yml

+36
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:

.github/workflows/caching.yml

+24-21
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
- master
2020

2121
jobs:
22+
2223
pre_job:
2324
runs-on: ubuntu-latest
2425
outputs:
@@ -37,7 +38,7 @@ jobs:
3738
cancel_others: false
3839
paths_ignore: '["hls-test-utils/**", "plugins/**", "src/**", "exe/**", "test/**", "shake-bench/**"]'
3940

40-
deps:
41+
caching:
4142
if: needs.pre_job.outputs.should_skip != 'true'
4243
needs: pre_job
4344
runs-on: ${{ matrix.os }}
@@ -55,34 +56,45 @@ jobs:
5556
- uses: actions/checkout@v2
5657
with:
5758
submodules: true
59+
5860
- uses: haskell/actions/setup@v1
5961
with:
60-
ghc-version : ${{ matrix.ghc }}
62+
ghc-version: ${{ matrix.ghc }}
6163
cabal-version: ${{ matrix.cabal }}
6264

63-
- if: matrix.os == 'windows-latest'
64-
name: Set some window specific things
65+
- if: runner.os == 'Windows'
66+
name: (Windows) Platform config
6567
run: |
6668
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
6769
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
68-
69-
- if: matrix.os != 'windows-latest'
70-
name: Set some linux/macOS specific things
70+
- if: ( runner.os == 'Linux' ) || ( runner.os == 'macOS' )
71+
name: (Linux,macOS) Platform config
7172
run: |
7273
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
7374
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
7475
7576
# Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file
7677
- if: matrix.ghc == '9.0.1'
77-
name: Use modified cabal.project for ghc9
78-
run: cp cabal-ghc901.project cabal.project
79-
80-
- if: matrix.ghc == '8.8.4' && matrix.os == 'windows-latest'
81-
name: Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows
78+
name: (GHC 9.0.1) Use modified `cabal.project`
79+
run: |
80+
cp cabal-ghc901.project cabal.project
81+
- if: runner.os == 'Windows' && matrix.ghc == '8.8.4'
82+
name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults
8283
run: |
8384
echo "package floskell" >> cabal.project
8485
echo " ghc-options: -O0" >> cabal.project
8586
87+
# Shorten binary names as a workaround for filepath length limits in Windows,
88+
# but since tests are hardcoded on this workaround -
89+
# all platforms (in 2021-12-07) need it.
90+
- name: Workaround shorten binary names
91+
run: |
92+
sed -i.bak -e 's/haskell-language-server/hls/g' \
93+
-e 's/haskell_language_server/hls/g' \
94+
haskell-language-server.cabal cabal.project
95+
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
96+
src/**/*.hs exe/*.hs
97+
8698
- name: Cache Cabal
8799
uses: actions/cache@v2
88100
env:
@@ -99,15 +111,6 @@ jobs:
99111
100112
- run: cabal update
101113

102-
# Need this to work around filepath length limits in Windows
103-
- name: Shorten binary names
104-
run: |
105-
sed -i.bak -e 's/haskell-language-server/hls/g' \
106-
-e 's/haskell_language_server/hls/g' \
107-
haskell-language-server.cabal cabal.project
108-
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
109-
src/**/*.hs exe/*.hs
110-
111114
# repeating builds to workaround segfaults in windows and ghc-8.8.4
112115
- name: Build
113116
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)