-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Fix other workflows to install Corepack as prereq #246
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 | ||||
---|---|---|---|---|---|---|
|
@@ -7,41 +7,47 @@ jobs: | |||||
prepare: | ||||||
name: Prepare | ||||||
runs-on: ubuntu-latest | ||||||
strategy: | ||||||
matrix: | ||||||
node-version: [18.x, 20.x] | ||||||
steps: | ||||||
- name: Use Node.js | ||||||
- uses: actions/checkout@v4 | ||||||
- name: Install Corepack via Node | ||||||
uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: 'lts/*' | ||||||
node-version-file: '.nvmrc' | ||||||
- name: Install Yarn | ||||||
run: corepack enable | ||||||
- uses: actions/checkout@v4 | ||||||
- name: Use Node.js and install dependencies | ||||||
- name: Install Node.js ${{ matrix.node-version }} and restore Yarn cache | ||||||
uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: 'lts/*' | ||||||
node-version: ${{ matrix.node-version }} | ||||||
cache: 'yarn' | ||||||
- name: Install Yarn dependencies | ||||||
- name: Install dependencies via Yarn | ||||||
run: yarn --immutable | ||||||
|
||||||
build: | ||||||
name: Build | ||||||
needs: prepare | ||||||
runs-on: ubuntu-latest | ||||||
needs: | ||||||
- prepare | ||||||
strategy: | ||||||
matrix: | ||||||
node-version: [20.x] | ||||||
steps: | ||||||
- name: Use Node.js | ||||||
- uses: actions/checkout@v4 | ||||||
- name: Install Corepack via Node | ||||||
uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: 'lts/*' | ||||||
node-version-file: '.nvmrc' | ||||||
- name: Install Yarn | ||||||
run: corepack enable | ||||||
- uses: actions/checkout@v4 | ||||||
- name: Use Node.js | ||||||
- name: Install Node.js ${{ matrix.node-version }} and restore Yarn cache | ||||||
uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: 'lts/*' | ||||||
node-version: ${{ matrix.node-version }} | ||||||
cache: 'yarn' | ||||||
- run: yarn --immutable --immutable-cache | ||||||
- name: Install dependencies via Yarn | ||||||
run: yarn --immutable --immutable-cache | ||||||
- run: yarn build | ||||||
- name: Require clean working directory | ||||||
shell: bash | ||||||
|
@@ -53,23 +59,26 @@ jobs: | |||||
|
||||||
lint: | ||||||
name: Lint | ||||||
needs: prepare | ||||||
runs-on: ubuntu-latest | ||||||
needs: | ||||||
- prepare | ||||||
strategy: | ||||||
matrix: | ||||||
node-version: [20.x] | ||||||
steps: | ||||||
- name: Use Node.js | ||||||
- uses: actions/checkout@v4 | ||||||
- name: Install Corepack via Node | ||||||
uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: 'lts/*' | ||||||
node-version-file: '.nvmrc' | ||||||
- name: Install Yarn | ||||||
run: corepack enable | ||||||
- uses: actions/checkout@v4 | ||||||
- name: Use Node.js | ||||||
- name: Install Node.js ${{ matrix.node-version }} and restore Yarn cache | ||||||
uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: 'lts/*' | ||||||
node-version: ${{ matrix.node-version }} | ||||||
cache: 'yarn' | ||||||
- run: yarn --immutable --immutable-cache | ||||||
- name: Install dependencies via Yarn | ||||||
run: yarn --immutable --immutable-cache | ||||||
- run: yarn lint | ||||||
- name: Validate RC changelog | ||||||
if: ${{ startsWith(github.head_ref, 'release/') }} | ||||||
|
@@ -87,26 +96,26 @@ jobs: | |||||
|
||||||
test: | ||||||
name: Test | ||||||
needs: prepare | ||||||
runs-on: ubuntu-latest | ||||||
needs: | ||||||
- prepare | ||||||
strategy: | ||||||
matrix: | ||||||
node-version: [18.x, 20.x] | ||||||
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.
Suggested change
|
||||||
steps: | ||||||
- name: Use Node.js | ||||||
- uses: actions/checkout@v4 | ||||||
- name: Install Corepack via Node | ||||||
uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: ${{ matrix.node-version }} | ||||||
node-version-file: '.nvmrc' | ||||||
- name: Install Yarn | ||||||
run: corepack enable | ||||||
- uses: actions/checkout@v4 | ||||||
- name: Use Node.js ${{ matrix.node-version }} | ||||||
- name: Install Node.js ${{ matrix.node-version }} and restore Yarn cache | ||||||
uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: ${{ matrix.node-version }} | ||||||
cache: 'yarn' | ||||||
- run: yarn --immutable --immutable-cache | ||||||
- name: Install dependencies via Yarn | ||||||
run: yarn --immutable --immutable-cache | ||||||
- run: yarn test | ||||||
- name: Require clean working directory | ||||||
shell: bash | ||||||
|
@@ -118,31 +127,32 @@ jobs: | |||||
|
||||||
compatibility-test: | ||||||
name: Compatibility test | ||||||
needs: prepare | ||||||
runs-on: ubuntu-latest | ||||||
needs: | ||||||
- prepare | ||||||
strategy: | ||||||
matrix: | ||||||
node-version: [18.x, 20.x] | ||||||
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.
Suggested change
|
||||||
steps: | ||||||
- name: Use Node.js | ||||||
- uses: actions/checkout@v4 | ||||||
- name: Install Corepack via Node | ||||||
uses: actions/setup-node@v4 | ||||||
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.
There was a valid reason to do Could potentially cause issues with any dependencies that rely on the specific package manager version in their installation step, if any (since 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. I didn't find evidence in the source that it installs dependencies — I think you still have to do that yourself. It does run As for your final point:
Does Yarn consult 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 does a few somewhat unexpected things, yes.. Among them: yarnpkg/berry#6258 |
||||||
with: | ||||||
node-version: ${{ matrix.node-version }} | ||||||
node-version-file: '.nvmrc' | ||||||
- name: Install Yarn | ||||||
run: corepack enable | ||||||
- uses: actions/checkout@v4 | ||||||
- name: Use Node.js ${{ matrix.node-version }} | ||||||
- name: Install Node.js ${{ matrix.node-version }} and restore Yarn cache | ||||||
uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: ${{ matrix.node-version }} | ||||||
cache: 'yarn' | ||||||
- run: rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn | ||||||
- name: Install dependencies via Yarn | ||||||
run: rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn | ||||||
- run: yarn test | ||||||
- name: Restore lockfile | ||||||
run: git restore yarn.lock | ||||||
- name: Require clean working directory | ||||||
shell: bash | ||||||
run: | | ||||||
git restore yarn.lock | ||||||
if ! git diff --exit-code; then | ||||||
echo "Working tree dirty at end of job" | ||||||
exit 1 | ||||||
|
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.