Skip to content

Commit 7ae913d

Browse files
authored
Merge branch 'master' into fix-tactics-hover
2 parents 5419bad + 2feabf3 commit 7ae913d

File tree

5 files changed

+143
-116
lines changed

5 files changed

+143
-116
lines changed

.circleci/config.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defaults: &defaults
1616
keys:
1717
- v4-stack-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }}
1818

19-
# Looking for the string [skip ci] in all the json returned by https://docs.github.com/en/rest/reference/pulls#get-a-pull-request
19+
# Looking for the string [skip circleci] in all the json returned by https://docs.github.com/en/rest/reference/pulls#get-a-pull-request
2020
- run:
2121
name: Skip ci setup
2222
command: |
@@ -26,7 +26,12 @@ defaults: &defaults
2626
PULL_REQUEST_URL=${CIRCLE_PULL_REQUEST/github.com/api.github.com/repos}
2727
PULL_REQUEST_URL=${PULL_REQUEST_URL/pull/pulls}
2828
echo "PULL_REQUEST_URL: $PULL_REQUEST_URL"
29-
SKIP_CI=$(curl $PULL_REQUEST_URL | grep -o "\\[skip ci\\]")
29+
SKIP_CI=$(curl $PULL_REQUEST_URL | grep -o "\\[skip circleci\\]")
30+
if [[ -z "$SKIP_CI" ]]; then
31+
PULL_REQUEST_COMMENTS_URL=${PULL_REQUEST_URL/pulls/issues}/comments
32+
echo "PULL_REQUEST_COMMENTS_URL: $PULL_REQUEST_COMMENTS_URL"
33+
SKIP_CI=$(curl $PULL_REQUEST_COMMENTS_URL | grep -o "\\[skip circleci\\]")
34+
fi
3035
echo "SKIP_CI: $SKIP_CI"
3136
fi
3237
echo "export SKIP_CI=$SKIP_CI" >> $BASH_ENV

.github/workflows/bench.yml

Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ jobs:
1717
cancel_others: true
1818
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "**.nix", "**/test/**", "flake.lock", "**/README.md", "FUNDING.yml"]'
1919

20-
bench-init:
20+
bench_init:
21+
if: needs.pre_job.outputs.should_skip != 'true'
2122
needs: pre_job
2223
runs-on: ${{ matrix.os }}
2324

@@ -28,19 +29,17 @@ jobs:
2829
os: [ubuntu-latest]
2930

3031
steps:
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
32+
- uses: actions/checkout@v2
33+
34+
- run: git fetch origin master # check the master branch for benchmarking
35+
36+
- uses: haskell/actions/setup@v1
3737
with:
3838
ghc-version: ${{ matrix.ghc }}
3939
cabal-version: '3.2'
4040
enable-stack: false
4141

42-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
43-
name: Cache Cabal
42+
- name: Cache Cabal
4443
uses: actions/cache@v2
4544
with:
4645
path: |
@@ -52,55 +51,47 @@ jobs:
5251
v2-${{ runner.os }}-${{ matrix.ghc }}-bench-
5352
v2-${{ runner.os }}-${{ matrix.ghc }}
5453
55-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
56-
run: cabal update
54+
- run: cabal update
5755

5856
# max-backjumps is increased as a temporary solution
5957
# for dependency resolution failure
60-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
61-
run: cabal configure --enable-benchmarks --max-backjumps 12000
58+
- run: cabal configure --enable-benchmarks --max-backjumps 12000
6259

63-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
64-
name: Build
60+
- name: Build
6561
shell: bash
6662
run: cabal build ghcide:benchHist
6763

68-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
69-
name: Bench init
64+
- name: Bench init
7065
shell: bash
7166
run: cabal bench ghcide:benchHist -j --benchmark-options="all-binaries"
7267

7368
# tar is required to preserve file permissions
7469
# compression speeds up upload/download nicely
75-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
76-
name: tar workspace
70+
- name: tar workspace
7771
shell: bash
7872
run: tar -czf workspace.tar.gz * .git
7973

80-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
81-
name: tar cabal
74+
- name: tar cabal
8275
run: |
8376
cd ~/.cabal
8477
tar -czf cabal.tar.gz *
8578
86-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
87-
name: Upload workspace
79+
- name: Upload workspace
8880
uses: actions/upload-artifact@v2
8981
with:
9082
name: workspace
9183
retention-days: 1
9284
path: workspace.tar.gz
9385

94-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
95-
name: Upload .cabal
86+
- name: Upload .cabal
9687
uses: actions/upload-artifact@v2
9788
with:
9889
name: cabal-home
9990
retention-days: 1
10091
path: ~/.cabal/cabal.tar.gz
10192

102-
bench-example:
103-
needs: [bench-init, pre_job]
93+
bench_example:
94+
needs: [bench_init, pre_job]
10495
runs-on: ${{ matrix.os }}
10596

10697
strategy:
@@ -111,47 +102,40 @@ jobs:
111102
example: ['cabal', 'lsp-types']
112103

113104
steps:
114-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
115-
uses: haskell/actions/setup@v1
105+
- uses: haskell/actions/setup@v1
116106
with:
117107
ghc-version: ${{ matrix.ghc }}
118108
cabal-version: '3.2'
119109
enable-stack: false
120110

121-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
122-
name: Download cabal home
111+
- name: Download cabal home
123112
uses: actions/download-artifact@v2
124113
with:
125114
name: cabal-home
126115
path: .
127116

128-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
129-
name: Download workspace
117+
- name: Download workspace
130118
uses: actions/download-artifact@v2
131119
with:
132120
name: workspace
133121
path: .
134122

135-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
136-
name: untar
123+
- name: untar
137124
run: |
138125
mkdir -p ~/.cabal
139126
tar xzf workspace.tar.gz
140127
tar xzf cabal.tar.gz --directory ~/.cabal
141128
142-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
143-
name: Bench
129+
- name: Bench
144130
shell: bash
145131
run: cabal bench ghcide:benchHist -j --benchmark-options="${{ matrix.example }}"
146132

147-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
148-
name: Display results
133+
- name: Display results
149134
shell: bash
150135
run: |
151136
column -s, -t < ghcide/bench-results/unprofiled/${{ matrix.example }}/results.csv | tee ghcide/bench-results/unprofiled/${{ matrix.example }}/results.txt
152137
153-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
154-
name: Archive benchmarking artifacts
138+
- name: Archive benchmarking artifacts
155139
uses: actions/upload-artifact@v2
156140
with:
157141
name: bench-results-${{ runner.os }}-${{ matrix.ghc }}
@@ -161,12 +145,24 @@ jobs:
161145
ghcide/bench-results/**/*.svg
162146
ghcide/bench-results/**/*.eventlog.html
163147
164-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
165-
name: Archive benchmark logs
148+
- name: Archive benchmark logs
166149
uses: actions/upload-artifact@v2
167150
with:
168151
name: bench-logs-${{ runner.os }}-${{ matrix.ghc }}
169152
path: |
170153
ghcide/bench-results/**/*.log
171154
ghcide/bench-results/**/*.eventlog
172155
ghcide/bench-results/**/*.hp
156+
157+
post_job:
158+
if: always()
159+
runs-on: ubuntu-latest
160+
needs: [pre_job, bench_init, bench_example]
161+
steps:
162+
- run: |
163+
echo "jobs info: ${{ toJSON(needs) }}"
164+
- if: contains(needs.*.result, 'failure')
165+
run: exit 1
166+
- if: contains(needs.*.result, 'cancelled')
167+
name: cancelling
168+
uses: andymckay/[email protected]

.github/workflows/nix.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828

2929
# Enter the development shell and run `cabal build`
3030
develop:
31+
if: needs.pre_job.outputs.should_skip_develop != 'true'
3132
needs: pre_job
3233
runs-on: ${{ matrix.os }}
3334

@@ -37,26 +38,22 @@ jobs:
3738
os: [ubuntu-latest, macOS-latest]
3839

3940
steps:
40-
- if: ${{ needs.pre_job.outputs.should_skip_develop != 'true' }}
41-
uses: actions/checkout@v2
41+
- uses: actions/checkout@v2
4242
with:
4343
submodules: true
44-
- if: ${{ needs.pre_job.outputs.should_skip_develop != 'true' }}
45-
uses: cachix/install-nix-action@v13
44+
- uses: cachix/install-nix-action@v13
4645
with:
4746
install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
4847
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
4948
extra_nix_config: |
5049
experimental-features = nix-command flakes
5150
nix_path: nixpkgs=channel:nixos-unstable
52-
- if: ${{ needs.pre_job.outputs.should_skip_develop != 'true' }}
53-
uses: cachix/cachix-action@v10
51+
- uses: cachix/cachix-action@v10
5452
with:
5553
name: haskell-language-server
5654
# Disable pushing, we will do that in job `build`
5755
skipPush: true
58-
- if: ${{ needs.pre_job.outputs.should_skip_develop != 'true' }}
59-
run: |
56+
- run: |
6057
nix develop --print-build-logs --command cabal update
6158
nix develop --print-build-logs --command cabal build
6259
@@ -66,10 +63,10 @@ jobs:
6663
# 2. Nix files are changed (runs on PR)
6764
build:
6865
needs: pre_job
69-
runs-on: ${{ matrix.os }}
66+
runs-on: matrix.os
7067
env:
7168
HAS_TOKEN: ${{ secrets.HLS_CACHIX_AUTH_TOKEN != '' }}
72-
if: ${{ needs.pre_job.outputs.should_skip_build != 'true' || (github.repository_owner == 'haskell' && github.ref == 'refs/heads/master') }}
69+
if: (needs.pre_job.outputs.should_skip_build != 'true' && needs.pre_job.outputs.should_skip_pr != 'true') || (github.repository_owner == 'haskell' && github.ref == 'refs/heads/master')
7370
strategy:
7471
fail-fast: false
7572
matrix:
@@ -104,3 +101,16 @@ jobs:
104101
- name: Push binaries
105102
if: ${{ env.HAS_TOKEN == 'true' }}
106103
run: nix path-info --json | jq -r '.[].path' | cachix push haskell-language-server
104+
105+
post_job:
106+
if: always()
107+
runs-on: ubuntu-latest
108+
needs: [pre_job, develop, build]
109+
steps:
110+
- run: |
111+
echo "jobs info: ${{ toJSON(needs) }}"
112+
- if: contains(needs.*.result, 'failure')
113+
run: exit 1
114+
- if: contains(needs.*.result, 'cancelled')
115+
name: cancelling
116+
uses: andymckay/[email protected]

0 commit comments

Comments
 (0)