@@ -105,9 +105,12 @@ jobs:
105105 # `job_build` can't see `job_install_deps` and what it returned)
106106 dependency_cache_key : ${{ needs.job_install_deps.outputs.dependency_cache_key }}
107107
108+ # This isn't a full `yarn build` using sucrase - it's just the cache from the normal build, with `build/cjs` and
109+ # `build/esm` overwritten by sucrase. This way we don't need to worry about all of the other random stuff which
110+ # packages build, because it will already be there.
108111 job_build_with_sucrase :
109- name : Build with sucrase
110- needs : job_install_deps
112+ name : Sucrase Build
113+ needs : [ job_install_deps, job_build]
111114 runs-on : ubuntu-latest
112115 timeout-minutes : 20
113116 steps :
@@ -122,19 +125,20 @@ jobs:
122125 with :
123126 path : ${{ env.CACHED_DEPENDENCY_PATHS }}
124127 key : ${{ needs.job_install_deps.outputs.dependency_cache_key }}
125- - name : Check build cache
128+ - name : Check tsc build cache
126129 uses : actions/cache@v2
127- id : cache_built_packages
130+ with :
131+ path : ${{ env.CACHED_BUILD_PATHS }}
132+ key : ${{ env.BUILD_CACHE_KEY }}
133+ - name : Check sucrase build cache
134+ uses : actions/cache@v2
135+ id : cache_built_sucrase_packages
128136 with :
129137 path : ${{ env.CACHED_BUILD_PATHS }}
130138 key : ${{ env.BUILD_CACHE_KEY }}-sucrase
131139 - name : Build packages with sucrase
132- # Under normal circumstances, using the git SHA as a cache key, there shouldn't ever be a cache hit on the built
133- # packages, and so `yarn build` should always run. This `if` check is therefore only there for testing CI issues
134- # where the built packages are beside the point. In that case, you can change `BUILD_CACHE_KEY` (at the top of
135- # this file) to a constant and skip rebuilding all of the packages each time CI runs.
136- if : steps.cache_built_packages.outputs.cache-hit == ''
137- run : ' yarn build:rollup && yarn build:types && yarn build:bundle'
140+ if : steps.cache_built_sucrase_packages.outputs.cache-hit == ''
141+ run : ' yarn build:rollup'
138142 outputs :
139143 # this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on
140144 # `job_build` can't see `job_install_deps` and what it returned)
0 commit comments