Skip to content

Commit bd2cbba

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 1259b4d commit bd2cbba

File tree

3 files changed

+83
-41
lines changed

3 files changed

+83
-41
lines changed

.github/workflows/bench.yml

Lines changed: 36 additions & 0 deletions
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

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ on:
3232
- master
3333

3434
jobs:
35+
3536
pre_job:
3637
runs-on: ubuntu-latest
3738
outputs:
@@ -50,7 +51,7 @@ jobs:
5051
cancel_others: false
5152
paths_ignore: '["hls-test-utils/**", "plugins/**", "src/**", "exe/**", "test/**", "shake-bench/**"]'
5253

53-
deps:
54+
caching:
5455
if: needs.pre_job.outputs.should_skip != 'true'
5556
needs: pre_job
5657
runs-on: ${{ matrix.os }}
@@ -68,34 +69,45 @@ jobs:
6869
- uses: actions/checkout@v2
6970
with:
7071
submodules: true
72+
7173
- uses: haskell/actions/setup@v1
7274
with:
73-
ghc-version : ${{ matrix.ghc }}
75+
ghc-version: ${{ matrix.ghc }}
7476
cabal-version: ${{ matrix.cabal }}
7577

76-
- if: matrix.os == 'windows-latest'
77-
name: Set some window specific things
78+
- if: runner.os == 'Windows'
79+
name: (Windows) Platform config
7880
run: |
7981
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
8082
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
81-
82-
- if: matrix.os != 'windows-latest'
83-
name: Set some linux/macOS specific things
83+
- if: ( runner.os == 'Linux' ) || ( runner.os == 'macOS' )
84+
name: (Linux,macOS) Platform config
8485
run: |
8586
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
8687
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
8788
8889
# Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file
8990
- if: matrix.ghc == '9.0.1'
90-
name: Use modified cabal.project for ghc9
91-
run: cp cabal-ghc901.project cabal.project
92-
93-
- if: matrix.ghc == '8.8.4' && matrix.os == 'windows-latest'
94-
name: Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows
91+
name: (GHC 9.0.1) Use modified `cabal.project`
92+
run: |
93+
cp cabal-ghc901.project cabal.project
94+
- if: runner.os == 'Windows' && matrix.ghc == '8.8.4'
95+
name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults
9596
run: |
9697
echo "package floskell" >> cabal.project
9798
echo " ghc-options: -O0" >> cabal.project
9899
100+
# Shorten binary names as a workaround for filepath length limits in Windows,
101+
# but since tests are hardcoded on this workaround -
102+
# all platforms (in 2021-12-07) need it.
103+
- name: Workaround 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+
99111
- name: Cache Cabal
100112
uses: actions/cache@v2
101113
env:
@@ -112,15 +124,6 @@ jobs:
112124
113125
- run: cabal update
114126

115-
# Need this to work around filepath length limits in Windows
116-
- name: Shorten binary names
117-
run: |
118-
sed -i.bak -e 's/haskell-language-server/hls/g' \
119-
-e 's/haskell_language_server/hls/g' \
120-
haskell-language-server.cabal cabal.project
121-
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
122-
src/**/*.hs exe/*.hs
123-
124127
# repeating builds to workaround segfaults in windows and ghc-8.8.4
125128
- name: Build
126129
run: cabal build --only-dependencies || cabal build --only-dependencies || cabal build --only-dependencies

.github/workflows/test.yml

Lines changed: 23 additions & 20 deletions
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)