Skip to content

Commit fc5a412

Browse files
authored
Fix ignore paths (#1656)
* Skip individual steps * Skip individual steps * And needs pre_job
1 parent 7971a37 commit fc5a412

File tree

2 files changed

+81
-67
lines changed

2 files changed

+81
-67
lines changed

.github/workflows/bench.yml

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ jobs:
1212
should_skip: ${{ steps.skip_check.outputs.should_skip }}
1313
steps:
1414
- id: skip_check
15-
uses: fkirc/skip-duplicate-actions@master
15+
uses: fkirc/skip-duplicate-actions@v3.4.0
1616
with:
1717
cancel_others: true
1818
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "nix/**", "**/test/**"]'
1919

2020
bench-init:
2121
needs: pre_job
22-
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
2322
runs-on: ${{ matrix.os }}
2423

2524
strategy:
@@ -29,18 +28,19 @@ jobs:
2928
os: [ubuntu-latest]
3029

3130
steps:
32-
# Cancel queued workflows from earlier commits in this branch
33-
- uses: fkirc/skip-duplicate-actions@master
34-
35-
- uses: actions/checkout@v2
36-
- run: git fetch origin master # check the master branch for benchmarking
37-
- uses: haskell/actions/setup@v1
31+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
32+
uses: actions/checkout@v2
33+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
34+
run: git fetch origin master # check the master branch for benchmarking
35+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
36+
uses: haskell/actions/setup@v1
3837
with:
3938
ghc-version: ${{ matrix.ghc }}
4039
cabal-version: '3.2'
4140
enable-stack: false
4241

43-
- name: Cache Cabal
42+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
43+
name: Cache Cabal
4444
uses: actions/cache@v2
4545
with:
4646
path: |
@@ -52,46 +52,53 @@ jobs:
5252
v2-${{ runner.os }}-${{ matrix.ghc }}-bench-
5353
v2-${{ runner.os }}-${{ matrix.ghc }}
5454
55-
- run: cabal update
55+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
56+
run: cabal update
5657

57-
- run: cabal configure --enable-benchmarks
58+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
59+
run: cabal configure --enable-benchmarks
5860

59-
- name: Build
61+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
62+
name: Build
6063
shell: bash
6164
run: cabal build ghcide:benchHist
6265

63-
- name: Bench init
66+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
67+
name: Bench init
6468
shell: bash
6569
run: cabal bench ghcide:benchHist -j --benchmark-options="all-binaries"
6670

6771
# tar is required to preserve file permissions
6872
# compression speeds up upload/download nicely
69-
- name: tar workspace
73+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
74+
name: tar workspace
7075
shell: bash
7176
run: tar -czf workspace.tar.gz * .git
7277

73-
- name: tar cabal
78+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
79+
name: tar cabal
7480
run: |
7581
cd ~/.cabal
7682
tar -czf cabal.tar.gz *
7783
78-
- name: Upload workspace
84+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
85+
name: Upload workspace
7986
uses: actions/upload-artifact@v2
8087
with:
8188
name: workspace
8289
retention-days: 1
8390
path: workspace.tar.gz
8491

85-
- name: Upload .cabal
92+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
93+
name: Upload .cabal
8694
uses: actions/upload-artifact@v2
8795
with:
8896
name: cabal-home
8997
retention-days: 1
9098
path: ~/.cabal/cabal.tar.gz
9199

92100
bench-example:
93-
needs: [pre_job, bench-init]
94-
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
101+
needs: [bench-init, pre_job]
95102
runs-on: ${{ matrix.os }}
96103

97104
strategy:
@@ -102,42 +109,46 @@ jobs:
102109
example: ['Cabal-3.0.0.0', 'lsp-types-1.0.0.1']
103110

104111
steps:
105-
# Cancel queued workflows from earlier commits in this branch
106-
- uses: fkirc/skip-duplicate-actions@master
107-
108-
- uses: haskell/actions/setup@v1
112+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
113+
uses: haskell/actions/setup@v1
109114
with:
110115
ghc-version: ${{ matrix.ghc }}
111116
cabal-version: '3.2'
112117
enable-stack: false
113118

114-
- name: Download cabal home
119+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
120+
name: Download cabal home
115121
uses: actions/download-artifact@v2
116122
with:
117123
name: cabal-home
118124
path: .
119125

120-
- name: Download workspace
126+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
127+
name: Download workspace
121128
uses: actions/download-artifact@v2
122129
with:
123130
name: workspace
124131
path: .
125132

126-
- name: untar
133+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
134+
name: untar
127135
run: |
128136
tar xzf workspace.tar.gz
129137
tar xzf cabal.tar.gz --directory ~/.cabal
130138
131-
- name: Bench
139+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
140+
name: Bench
132141
shell: bash
133142
run: cabal bench ghcide:benchHist -j --benchmark-options="${{ matrix.example }}"
134143

135-
- name: Display results
144+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
145+
name: Display results
136146
shell: bash
137147
run: |
138148
column -s, -t < ghcide/bench-results/unprofiled/${{ matrix.example }}/results.csv | tee ghcide/bench-results/unprofiled/${{ matrix.example }}/results.txt
139149
140-
- name: Archive benchmarking artifacts
150+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
151+
name: Archive benchmarking artifacts
141152
uses: actions/upload-artifact@v2
142153
with:
143154
name: bench-results-${{ runner.os }}-${{ matrix.ghc }}
@@ -147,7 +158,8 @@ jobs:
147158
ghcide/bench-results/**/*.svg
148159
ghcide/bench-results/**/*.eventlog.html
149160
150-
- name: Archive benchmark logs
161+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
162+
name: Archive benchmark logs
151163
uses: actions/upload-artifact@v2
152164
with:
153165
name: bench-logs-${{ runner.os }}-${{ matrix.ghc }}

.github/workflows/test.yml

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ jobs:
1616
should_skip: ${{ steps.skip_check.outputs.should_skip }}
1717
steps:
1818
- id: skip_check
19-
uses: fkirc/skip-duplicate-actions@master
19+
uses: fkirc/skip-duplicate-actions@v3.4.0
2020
with:
2121
cancel_others: true
2222
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "nix/**"]'
2323

24-
2524
test:
2625
needs: pre_job
27-
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
2826
runs-on: ${{ matrix.os }}
2927
strategy:
3028
fail-fast: true
@@ -58,33 +56,34 @@ jobs:
5856
# ghc: '8.6.4'
5957

6058
steps:
61-
# Cancel queued workflows from earlier commits in this branch
62-
- uses: fkirc/skip-duplicate-actions@master
63-
64-
- uses: actions/checkout@v2
59+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
60+
uses: actions/checkout@v2
6561
with:
6662
submodules: true
67-
- uses: haskell/actions/setup@v1
63+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
64+
uses: haskell/actions/setup@v1
6865
with:
6966
ghc-version: ${{ matrix.ghc }}
7067
cabal-version: "3.2"
7168

72-
- run: ./fmt.sh
69+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
70+
run: ./fmt.sh
7371
name: "HLint via ./fmt.sh"
7472

75-
- name: Set some window specific things
76-
if: matrix.os == 'windows-latest'
73+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.os == 'windows-latest'}}
74+
name: Set some window specific things
7775
run: |
7876
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
7977
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
8078
81-
- name: Set some linux/macOS specific things
82-
if: matrix.os != 'windows-latest'
79+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.os != 'windows-latest'}}
80+
name: Set some linux/macOS specific things
8381
run: |
8482
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
8583
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
8684
87-
- name: Cache Cabal
85+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
86+
name: Cache Cabal
8887
uses: actions/cache@v2
8988
env:
9089
cache-name: cache-cabal
@@ -98,28 +97,31 @@ jobs:
9897
v2-${{ runner.os }}-${{ matrix.ghc }}-build-
9998
v2-${{ runner.os }}-${{ matrix.ghc }}
10099
101-
- run: cabal update
100+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
101+
run: cabal update
102102

103103
# Need this to work around filepath length limits in Windows
104-
- name: Shorten binary names
104+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
105+
name: Shorten binary names
105106
run: |
106107
sed -i.bak -e 's/haskell-language-server/hls/g' \
107108
-e 's/haskell_language_server/hls/g' \
108109
haskell-language-server.cabal
109110
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
110111
src/**/*.hs exe/*.hs
111112
112-
- name: Build
113+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
114+
name: Build
113115
# Retry it three times to workaround compiler segfaults in windows
114116
run: cabal build || cabal build || cabal build
115117

116-
- name: Test ghcide
117-
if: ${{ matrix.test }}
118+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
119+
name: Test ghcide
118120
# run the tests without parallelism to avoid running out of memory
119121
run: cabal test ghcide --test-options="-j1 --rerun-update" || cabal test ghcide --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test ghcide --test-options="-j1 --rerun"
120122

121-
- name: Test func-test suite
122-
if: ${{ matrix.test }}
123+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
124+
name: Test func-test suite
123125
env:
124126
HLS_TEST_EXE: hls
125127
HLS_WRAPPER_TEST_EXE: hls-wrapper
@@ -128,8 +130,8 @@ jobs:
128130
# instances to be spun up for the poor github actions runner to handle
129131
run: cabal test func-test --test-options="-j1 --rerun --rerun-update" || cabal test func-test --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test func-test --test-options="-j1 --rerun"
130132

131-
- name: Test wrapper-test suite
132-
if: ${{ matrix.test }}
133+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
134+
name: Test wrapper-test suite
133135
env:
134136
HLS_TEST_EXE: hls
135137
HLS_WRAPPER_TEST_EXE: hls-wrapper
@@ -138,30 +140,30 @@ jobs:
138140
# instances to be spun up for the poor github actions runner to handle
139141
run: cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1"
140142

141-
- name: Test hls-brittany-plugin
142-
if: ${{ matrix.test }}
143+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
144+
name: Test hls-brittany-plugin
143145
run: cabal test hls-brittany-plugin || cabal test hls-brittany-plugin --test-options="-j1"
144146

145-
- name: Test hls-class-plugin
146-
if: ${{ matrix.test }}
147+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
148+
name: Test hls-class-plugin
147149
run: cabal test hls-class-plugin || cabal test hls-class-plugin --test-options="-j1"
148150

149-
- name: Test hls-eval-plugin
150-
if: ${{ matrix.test }}
151+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
152+
name: Test hls-eval-plugin
151153
run: cabal test hls-eval-plugin --test-options="-j1 --rerun" || cabal test hls-eval-plugin --test-options="-j1 --rerun"
152154

153-
- name: Test hls-haddock-comments-plugin
154-
if: ${{ matrix.test }}
155+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
156+
name: Test hls-haddock-comments-plugin
155157
run: cabal test hls-haddock-comments-plugin || cabal test hls-haddock-comments-plugin --test-options="-j1"
156158

157-
- name: Test hls-splice-plugin
158-
if: ${{ matrix.test }}
159+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
160+
name: Test hls-splice-plugin
159161
run: cabal test hls-splice-plugin || cabal test hls-splice-plugin --test-options="-j1"
160162

161-
- name: Test hls-stylish-haskell-plugin
162-
if: ${{ matrix.test }}
163+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
164+
name: Test hls-stylish-haskell-plugin
163165
run: cabal test hls-stylish-haskell-plugin || cabal test hls-stylish-haskell-plugin --test-options="-j1"
164166

165-
- name: Test hls-tactics-plugin test suite
166-
if: ${{ matrix.test }}
167+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
168+
name: Test hls-tactics-plugin test suite
167169
run: LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-tactics-plugin --test-options="-j1"

0 commit comments

Comments
 (0)