-
Notifications
You must be signed in to change notification settings - Fork 6k
refactor(ci): fix fetch-depth and add some caching #5563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ concurrency: | |
# Note: if: success() is used in several jobs - | ||
# this ensures that it only executes if all previous jobs succeeded. | ||
|
||
# if: steps.cache-yarn.outputs.cache-hit != 'true' | ||
# if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
# will skip running `yarn install` if it successfully fetched from cache | ||
|
||
jobs: | ||
|
@@ -29,9 +29,6 @@ jobs: | |
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: Install Node.js v16 | ||
uses: actions/setup-node@v3 | ||
|
@@ -40,9 +37,14 @@ jobs: | |
|
||
- name: Install helm | ||
uses: azure/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install helm kubeval plugin | ||
run: helm plugin install https://github.com/instrumenta/helm-kubeval | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need this for our |
||
|
||
- name: Fetch dependencies from cache | ||
id: cache-yarn | ||
id: cache-node-modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: "**/node_modules" | ||
|
@@ -51,8 +53,8 @@ jobs: | |
yarn-build- | ||
|
||
- name: Install dependencies | ||
if: steps.cache-yarn.outputs.cache-hit != 'true' | ||
run: yarn --frozen-lockfile | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile | ||
jsjoeio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Run yarn fmt | ||
run: yarn fmt | ||
|
@@ -73,11 +75,13 @@ jobs: | |
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: Install quilt | ||
run: sudo apt update && sudo apt install quilt | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Neat action! |
||
with: | ||
packages: quilt | ||
version: 1.0 | ||
|
||
- name: Patch Code | ||
run: quilt push -a | ||
|
@@ -88,7 +92,7 @@ jobs: | |
node-version: "16" | ||
|
||
- name: Fetch dependencies from cache | ||
id: cache-yarn | ||
id: cache-node-modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: "**/node_modules" | ||
|
@@ -97,7 +101,7 @@ jobs: | |
yarn-build- | ||
|
||
- name: Install dependencies | ||
if: steps.cache-yarn.outputs.cache-hit != 'true' | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: yarn --frozen-lockfile | ||
|
||
- name: Build code-server | ||
|
@@ -171,8 +175,6 @@ jobs: | |
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
|
@@ -224,8 +226,6 @@ jobs: | |
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Node.js v16 | ||
uses: actions/setup-node@v3 | ||
|
@@ -262,8 +262,18 @@ jobs: | |
- name: Build standalone release | ||
run: source scl_source enable devtoolset-9 && yarn release:standalone | ||
|
||
- name: Fetch dependencies from cache | ||
id: cache-node-modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: "**/node_modules" | ||
key: yarn-build-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn-build- | ||
Comment on lines
+265
to
+272
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like we could add this block to the I think we might want to add platform keys so we cache separately for different platforms. The reason being is that I vaguely recall seeing native modules not rebuild if they already exist even if they are for the wrong platform. So something like:
Also the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatively we could remove just the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good thinking! I'm going to add this to my todo list since I didn't get to it here. I'm thinking we do the approach you suggested and move the platform steps out of |
||
|
||
- name: Install test dependencies | ||
run: SKIP_SUBMODULE_DEPS=1 yarn install | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile | ||
|
||
- name: Run integration tests on standalone release | ||
run: yarn test:integration | ||
|
@@ -320,8 +330,6 @@ jobs: | |
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Node.js v16 | ||
uses: actions/setup-node@v3 | ||
|
@@ -373,8 +381,6 @@ jobs: | |
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Node.js v16 | ||
uses: actions/setup-node@v3 | ||
|
@@ -398,7 +404,17 @@ jobs: | |
- name: Build standalone release | ||
run: yarn release:standalone | ||
|
||
- name: Fetch dependencies from cache | ||
id: cache-node-modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: "**/node_modules" | ||
key: yarn-build-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn-build- | ||
Comment on lines
+407
to
+414
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as previous except |
||
|
||
- name: Install test dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: SKIP_SUBMODULE_DEPS=1 yarn install | ||
|
||
- name: Run integration tests on standalone release | ||
|
@@ -425,16 +441,14 @@ jobs: | |
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Node.js v16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
|
||
- name: Fetch dependencies from cache | ||
id: cache-yarn | ||
id: cache-node-modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: "**/node_modules" | ||
|
@@ -455,7 +469,7 @@ jobs: | |
mv code-server*-linux-amd64 code-server-linux-amd64 | ||
|
||
- name: Install dependencies | ||
if: steps.cache-yarn.outputs.cache-hit != 'true' | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile | ||
|
||
- name: Install Playwright OS dependencies | ||
|
@@ -488,16 +502,14 @@ jobs: | |
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Node.js v16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
|
||
- name: Fetch dependencies from cache | ||
id: cache-yarn | ||
id: cache-node-modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: "**/node_modules" | ||
|
@@ -518,7 +530,7 @@ jobs: | |
mv code-server*-linux-amd64 code-server-linux-amd64 | ||
|
||
- name: Install dependencies | ||
if: steps.cache-yarn.outputs.cache-hit != 'true' | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile | ||
|
||
- name: Install Playwright OS dependencies | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes warning from
helm
. Token needed for v3 and later.