Skip to content

Commit cc27b8a

Browse files
authored
run main.yml for main branch so that the cache is shared across branches
https://github.com/actions/cache/blob/main/tips-and-workarounds.md#use-cache-across-feature-branches >Reusing cache across feature branches is not allowed today to provide cache isolation. However if both feature branches are from the default branch, a good way to achieve this is to ensure that the default branch has a cache. This cache will then be consumable by both feature branches.
1 parent aa544dc commit cc27b8a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ concurrency:
44
cancel-in-progress: true
55
on:
66
pull_request:
7+
push:
8+
branches: [main]
79
defaults:
810
run:
911
shell: bash
@@ -111,6 +113,7 @@ jobs:
111113
if: steps.cache-crate.outputs.cache-hit != 'true'
112114

113115
run_wpt:
116+
if: github.ref != 'refs/heads/main'
114117
name: Run Web Platform Tests
115118
strategy:
116119
matrix:
@@ -158,6 +161,7 @@ jobs:
158161
# Consumes all published artifacts from all the previous build steps, and runs
159162
# the integration tests for the linux build.
160163
sdktest:
164+
if: github.ref != 'refs/heads/main'
161165
runs-on: ubuntu-latest
162166
needs: [build]
163167
strategy:
@@ -257,6 +261,7 @@ jobs:
257261
run: ci/shellcheck.sh
258262

259263
format:
264+
if: github.ref != 'refs/heads/main'
260265
runs-on: ubuntu-latest
261266
steps:
262267
- uses: actions/checkout@v3
@@ -267,6 +272,7 @@ jobs:
267272
ci/rustfmt.sh
268273
269274
test-npm-package:
275+
if: github.ref != 'refs/heads/main'
270276
runs-on: ubuntu-latest
271277
needs: [build]
272278
steps:
@@ -283,6 +289,7 @@ jobs:
283289
- run: npm test
284290

285291
e2e:
292+
if: github.ref != 'refs/heads/main'
286293
runs-on: ubuntu-latest
287294
needs: [build]
288295
strategy:

0 commit comments

Comments
 (0)