@@ -105,9 +105,12 @@ jobs:
105
105
# `job_build` can't see `job_install_deps` and what it returned)
106
106
dependency_cache_key : ${{ needs.job_install_deps.outputs.dependency_cache_key }}
107
107
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.
108
111
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]
111
114
runs-on : ubuntu-latest
112
115
timeout-minutes : 20
113
116
steps :
@@ -122,19 +125,20 @@ jobs:
122
125
with :
123
126
path : ${{ env.CACHED_DEPENDENCY_PATHS }}
124
127
key : ${{ needs.job_install_deps.outputs.dependency_cache_key }}
125
- - name : Check build cache
128
+ - name : Check tsc build cache
126
129
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
128
136
with :
129
137
path : ${{ env.CACHED_BUILD_PATHS }}
130
138
key : ${{ env.BUILD_CACHE_KEY }}-sucrase
131
139
- 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'
138
142
outputs :
139
143
# this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on
140
144
# `job_build` can't see `job_install_deps` and what it returned)
0 commit comments