From d981ed20101b17c4c16569f8f6fd444ad8f407c2 Mon Sep 17 00:00:00 2001 From: Arya Irani Date: Fri, 22 Mar 2024 14:06:49 -0600 Subject: [PATCH] tweak some workflows --- .github/workflows/build-optimized-ucm.yaml | 2 + .github/workflows/pre-release.yaml | 4 +- .github/workflows/update-transcripts.yaml | 45 +--------------------- 3 files changed, 7 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build-optimized-ucm.yaml b/.github/workflows/build-optimized-ucm.yaml index 7453191396..00f4016f35 100644 --- a/.github/workflows/build-optimized-ucm.yaml +++ b/.github/workflows/build-optimized-ucm.yaml @@ -1,3 +1,5 @@ +name: build optimized ucm + on: workflow_call: inputs: diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index c5ca77957e..e3d713c7c4 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -1,4 +1,4 @@ -name: "pre-release" +name: pre-release defaults: run: @@ -10,6 +10,8 @@ on: branches: [ trunk ] types: - completed + workflow_dispatch: + jobs: build-ucm: uses: ./.github/workflows/build-optimized-ucm.yaml diff --git a/.github/workflows/update-transcripts.yaml b/.github/workflows/update-transcripts.yaml index b659a46570..441833f518 100644 --- a/.github/workflows/update-transcripts.yaml +++ b/.github/workflows/update-transcripts.yaml @@ -15,50 +15,9 @@ jobs: - macOS-12 steps: - uses: actions/checkout@v4 - - id: stackage-resolver - name: record stackage resolver - # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files - # looks for `resolver: nightly-yyyy-mm-dd` or `resolver: lts-xx.yy` in `stack.yaml` and splits it into - # `nightly` or `lts-xx`. the whole resolver string is put into resolver_long as a backup cache key - # ${{ steps.stackage-resolver.outputs.resolver_short }} - # ${{ steps.stackage-resolver.outputs.resolver_long }} - run: | - grep resolver stack.yaml | awk '{ x="resolver_short="; if (split($2,a,"-") > 2) print x a[1]; else {split($2,b,"."); print x b[1]}}' >> "$GITHUB_OUTPUT" - grep resolver stack.yaml | awk '{print "resolver_long="$2}' >> "$GITHUB_OUTPUT" - # Cache ~/.stack, keyed by the contents of 'stack.yaml'. - - uses: actions/cache@v3 - name: cache ~/.stack (unix) - if: runner.os != 'Windows' - with: - path: ~/.stack - key: stack-1_${{matrix.os}}-${{ steps.stackage-resolver.outputs.resolver_long }}-${{hashFiles('**/stack.yaml')}}-${{github.sha}} - # Fall-back to use the most recent cache for the stack.yaml, or failing that the OS - restore-keys: | - stack-1_${{matrix.os}}-${{ steps.stackage-resolver.outputs.resolver_long }}-${{hashFiles('**/stack.yaml')}}- - stack-1_${{matrix.os}}-${{ steps.stackage-resolver.outputs.resolver_long }}- - stack-1_${{matrix.os}}-${{ steps.stackage-resolver.outputs.resolver_short }}- - stack-1_${{matrix.os}}-${{ steps.stackage-resolver.outputs.resolver_short }}. - stack-1_${{matrix.os}}- - - # Cache each local package's ~/.stack-work for fast incremental builds in CI. - - uses: actions/cache@v3 - name: cache .stack-work + - uses: unisonweb/actions/stack/cache/restore@main with: - path: | - **/.stack-work - # Main cache key: commit hash. This should always result in a cache miss... - # So when loading a cache we'll always fall back to the restore-keys, - # which should load the most recent cache via a prefix search on the most - # recent branch cache. - # Then it will save a new cache at this commit sha, which should be used by - # the next build on this branch. - key: stack-work-4_${{matrix.os}}-${{ steps.stackage-resolver.outputs.resolver_short }}-${{hashFiles('**/stack.yaml')}}-${{github.sha}} - restore-keys: | - stack-work-4_${{matrix.os}}-${{ steps.stackage-resolver.outputs.resolver_long }}-${{hashFiles('**/stack.yaml')}}- - stack-work-4_${{matrix.os}}-${{ steps.stackage-resolver.outputs.resolver_long }}- - stack-work-4_${{matrix.os}}-${{ steps.stackage-resolver.outputs.resolver_short }}- - stack-work-4_${{matrix.os}}-${{ steps.stackage-resolver.outputs.resolver_short }}. - stack-work-4_${{matrix.os}}- + cache-prefix: ci1 - name: install stack uses: unisonweb/actions/stack/install@main