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+
0 commit comments