From 2b3d9d023a3605e699a5b88e4b0f2da78dd32248 Mon Sep 17 00:00:00 2001 From: Hrutvik Kanabar Date: Thu, 8 Aug 2024 09:40:38 +0100 Subject: [PATCH] Streamline CI workflow YAML Reduce line count and escaped quotes --- .github/workflows/pure.yml | 127 ++++++++++++------------------------- 1 file changed, 39 insertions(+), 88 deletions(-) diff --git a/.github/workflows/pure.yml b/.github/workflows/pure.yml index 8b40d05a..af34ae23 100644 --- a/.github/workflows/pure.yml +++ b/.github/workflows/pure.yml @@ -36,8 +36,7 @@ jobs: steps: - name: Update PATH - run: | - echo "$HOLDIR/bin" >> $GITHUB_PATH + run: echo "$HOLDIR/bin" >> $GITHUB_PATH - name: Get build-essentials run: | apt update @@ -89,95 +88,51 @@ jobs: bin/build - name: Build CakeML misc - run: | - cd $CAKEMLDIR/misc - Holmake + run: cd $CAKEMLDIR/misc && Holmake - name: Build CakeML semantics - run: | - cd $CAKEMLDIR/semantics - Holmake + run: cd $CAKEMLDIR/semantics && Holmake - name: Build CakeML semantics/proofs - run: | - cd $CAKEMLDIR/semantics/proofs - Holmake + run: cd $CAKEMLDIR/semantics/proofs && Holmake - name: Build CakeML semantics/alt_semantics - run: | - cd $CAKEMLDIR/semantics/alt_semantics - Holmake + run: cd $CAKEMLDIR/semantics/alt_semantics && Holmake - name: Build CakeML semantics/alt_semantics/proofs - run: | - cd $CAKEMLDIR/semantics/alt_semantics/proofs - Holmake + run: cd $CAKEMLDIR/semantics/alt_semantics/proofs && Holmake - name: Build CakeML basis/pure - run: | - cd $CAKEMLDIR/basis/pure - Holmake + run: cd $CAKEMLDIR/basis/pure && Holmake - name: Build misc - run: | - cd pure/misc - Holmake + run: cd pure/misc && Holmake - name: Build language - run: | - cd pure/language - Holmake + run: cd pure/language && Holmake - name: Build meta-theory - run: | - cd pure/meta-theory - Holmake + run: cd pure/meta-theory && Holmake - name: Build compiler/backend - run: | - cd pure/compiler/backend - Holmake + run: cd pure/compiler/backend && Holmake - name: Build compiler/backend/languages - run: | - cd pure/compiler/backend/languages - Holmake + run: cd pure/compiler/backend/languages && Holmake - name: Build compiler/backend/languages/semantics - run: | - cd pure/compiler/backend/languages/semantics - Holmake + run: cd pure/compiler/backend/languages/semantics && Holmake - name: Build compiler/backend/languages/properties - run: | - cd pure/compiler/backend/languages/properties - Holmake + run: cd pure/compiler/backend/languages/properties && Holmake - name: Build typing - run: | - cd pure/typing - Holmake + run: cd pure/typing && Holmake - name: Build compiler/backend/passes - run: | - cd pure/compiler/backend/passes - Holmake + run: cd pure/compiler/backend/passes && Holmake - name: Build compiler/backend/passes/proofs - run: | - cd pure/compiler/backend/passes/proofs - Holmake + run: cd pure/compiler/backend/passes/proofs && Holmake - name: Build compiler/backend/languages/relations - run: | - cd pure/compiler/backend/languages/relations - Holmake + run: cd pure/compiler/backend/languages/relations && Holmake - name: Build compiler/parsing - run: | - cd pure/compiler/parsing - Holmake + run: cd pure/compiler/parsing && Holmake - name: Build compiler - run: | - cd pure/compiler - Holmake + run: cd pure/compiler && Holmake - name: Build CakeML compiler/backend/proofs - run: | - cd $CAKEMLDIR/compiler/backend/proofs - Holmake + run: cd $CAKEMLDIR/compiler/backend/proofs && Holmake - name: Build compiler/proofs - run: | - cd pure/compiler/proofs - Holmake + run: cd pure/compiler/proofs && Holmake - name: Build compiler/binary - run: | - cd pure/compiler/binary - Holmake + run: cd pure/compiler/binary && Holmake - name: Save build artifact uses: actions/upload-artifact@v3 @@ -186,9 +141,7 @@ jobs: path: pure/compiler/binary/pure.S - name: Build examples - run: | - cd pure/examples - make check + run: cd pure/examples && make check - name: Check that benchmarks compile run: | apt install -y python3 python3-pip @@ -243,25 +196,23 @@ jobs: steps: - name: Get curl - run: | - apt update - apt install -y curl + run: apt update && apt install -y curl - name: Notify CakeML Discord run: > curl --silent --show-error --request POST --header "Content-type: application/json;charset=utf-8" - --data "{\"embeds\": [{ - \"title\": \"CI #${{ github.run_number }}\", - \"description\": \"${{ needs.build.result == 'success' && 'Passed' || 'Failed' }}\", - \"url\": \"https://github.com/CakeML/pure/actions/runs/${{ github.run_id }}\", - \"color\": ${{ needs.build.result == 'success' && 8311585 || 13632027 }}, - \"author\": { - \"name\": \"PureCake CI\", - \"url\": \"https://github.com/CakeML/pure/actions/workflows/pure.yml\"}, - \"fields\": [ - {\"name\": \"HOL commit\", \"inline\": true, - \"value\": \"[${{ needs.build.outputs.hol_short_sha }}](https://github.com/HOL-Theorem-Prover/HOL/commit/${{ needs.build.outputs.hol_sha }})\"}, - {\"name\": \"CakeML commit\", \"inline\": true, - \"value\": \"[${{ needs.build.outputs.cakeml_short_sha }}](https://github.com/CakeML/cakeml/commit/${{ needs.build.outputs.cakeml_sha }})\"}] - }]}" + --data '{"embeds": [{ + "title": "CI #${{ github.run_number }}", + "description": "${{ needs.build.result == 'success' && 'Passed' || 'Failed' }}", + "url": "https://github.com/CakeML/pure/actions/runs/${{ github.run_id }}", + "color": ${{ needs.build.result == 'success' && 8311585 || 13632027 }}, + "author": { + "name": "PureCake CI", + "url": "https://github.com/CakeML/pure/actions/workflows/pure.yml"}, + "fields": [ + {"name": "HOL commit", "inline": true, + "value": "[${{ needs.build.outputs.hol_short_sha }}](https://github.com/HOL-Theorem-Prover/HOL/commit/${{ needs.build.outputs.hol_sha }})"}, + {"name": "CakeML commit", "inline": true, + "value": "[${{ needs.build.outputs.cakeml_short_sha }}](https://github.com/CakeML/cakeml/commit/${{ needs.build.outputs.cakeml_sha }})"}] + }]}' ${{ secrets.DISCORD_WEBHOOK }}