Skip to content
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

chore: update dependencies, remove unused ones #100

Merged
merged 20 commits into from
May 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
56 changes: 28 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,38 @@ jobs:
strategy:
matrix:
platform:
- [linux, ubuntu-latest]
- [darwin, macos-latest]
- [linux, ubuntu-latest]
- [darwin, macos-latest]

runs-on: ${{matrix.platform[1]}}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install Node
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x

- name: 'Build Node with corepack master'
run: |
yarn install --immutable
yarn pack
git clone -b mael/pmm --depth=1 https://github.com/arcanis/node.git node && cd node
git config user.name 'John Doe'
git config user.email '[email protected]'
rm -rf deps/corepack && tar xvf ../package.tgz && mv package deps/corepack
git add .
if ! git diff-index --quiet HEAD; then
git commit -m 'Updates corepack'
git show --name-status
fi
./configure
DISTTYPE=nightly DATESTRING=YYYY-MM-DD COMMIT=XXXX make binary -j8
mv node-v15.0.0-nightlyYYYY-MM-DDXXXX-*.tar.gz node-corepack-${{matrix.platform[0]}}-x64.tar.gz
- name: "Build Node with corepack master"
run: |
corepack yarn install --immutable
corepack yarn pack
Comment on lines +26 to +27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you call corepack yarn rather than just yarn (same in the other places)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make it explicit that we want to use the Corepack version of Yarn, in case Yarn v1.x is installed on the runner. Also, if someone is using this file to know what command to use to run the tests, it's the most likely command to succeed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, perhaps calling corepack enable (or perhaps sudo corepack enable) beforehand would be better - from a CLI user experience point of view, I'd prefer if Corepack didn't require any change, to guarantee reduced friction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that might be desirable for CLI usage, I'm doubtful it's a valid point in a CI context. The tests already ensures that calling the corepack binary is optional once corepack enable has been run, right?

Adding a corepack enable step in CI seems "wasteful" to me, but if you feel strongly about this, that's fine by me. wdyt?

git clone -b mael/pmm --depth=1 https://github.com/arcanis/node.git node && cd node
git config user.name 'John Doe'
git config user.email '[email protected]'
rm -rf deps/corepack && tar xvf ../package.tgz && mv package deps/corepack
git add .
if ! git diff-index --quiet HEAD; then
git commit -m 'Updates corepack'
git show --name-status
fi
./configure
DISTTYPE=nightly DATESTRING=YYYY-MM-DD COMMIT=XXXX make binary -j8
mv node-v15.0.0-nightlyYYYY-MM-DDXXXX-*.tar.gz node-corepack-${{matrix.platform[0]}}-x64.tar.gz

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: node-corepack-${{matrix.platform[0]}}-x64
path: node/node-corepack-${{matrix.platform[0]}}-x64.tar.gz
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: node-corepack-${{matrix.platform[0]}}-x64
path: node/node-corepack-${{matrix.platform[0]}}-x64.tar.gz
42 changes: 21 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,57 +8,57 @@ on:

jobs:
chore:
name: 'Testing chores'
name: "Testing chores"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- run: |
git fetch --no-tags --unshallow origin HEAD main
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: 14
arcanis marked this conversation as resolved.
Show resolved Hide resolved

- name: 'Check that the cache files are consistent with their remote sources'
- name: "Check that the cache files are consistent with their remote sources"
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- .yarn/cache | wc -l) -gt 0 ]]; then
yarn --immutable --immutable-cache --check-cache
corepack yarn --immutable --immutable-cache --check-cache
fi
shell: bash
if: |
github.event.pull_request != ''
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}

- name: 'Check for type errors'
run: yarn typecheck
- name: "Check for type errors"
run: corepack yarn typecheck

build:
strategy:
fail-fast: false
matrix:
node:
- 14
- 14
platform:
- ubuntu-latest
- macos-latest
- windows-latest
- ubuntu-latest
- macos-latest
- windows-latest

name: '${{matrix.platform}} w/ Node.js ${{matrix.node}}.x'
name: "${{matrix.platform}} w/ Node.js ${{matrix.node}}.x"
runs-on: ${{matrix.platform}}
needs: chore

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: 'Use Node.js ${{matrix.node}}.x'
uses: actions/setup-node@master
with:
node-version: ${{matrix.node}}.x
- name: "Use Node.js ${{matrix.node}}.x"
uses: actions/setup-node@v3
with:
node-version: ${{matrix.node}}.x

- run: yarn install --immutable
- run: yarn build # We need the stubs to run the tests
- run: yarn eslint
- run: yarn jest
- run: corepack yarn install --immutable
- run: corepack yarn build # We need the stubs to run the tests
- run: corepack yarn eslint
- run: corepack yarn jest
76 changes: 38 additions & 38 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,52 @@ name: Version Sync
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install Node
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: 'Update the package manager versions'
run: |
LATEST_NPM=$(curl https://registry.npmjs.org/npm | jq '.["dist-tags"].latest')
LATEST_PNPM=$(curl https://registry.npmjs.org/pnpm | jq '.["dist-tags"].latest')
LATEST_YARN=$(curl https://registry.npmjs.org/yarn | jq '.["dist-tags"].latest')
LATEST_BERRY=$(curl https://repo.yarnpkg.com/tags | jq '.latest.stable')

jq < config.json > config.json.new '. * '"{
definitions: {
npm: {
default: $LATEST_NPM,
},
pnpm: {
default: $LATEST_PNPM,
},
yarn: {
default: $LATEST_YARN,
transparent: {
default: $LATEST_BERRY,
- uses: actions/checkout@v3

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x

- name: "Update the package manager versions"
run: |
LATEST_NPM=$(curl https://registry.npmjs.org/npm | jq '.["dist-tags"].latest')
LATEST_PNPM=$(curl https://registry.npmjs.org/pnpm | jq '.["dist-tags"].latest')
LATEST_YARN=$(curl https://registry.npmjs.org/yarn | jq '.["dist-tags"].latest')
LATEST_BERRY=$(curl https://repo.yarnpkg.com/tags | jq '.latest.stable')

jq < config.json > config.json.new '. * '"{
definitions: {
npm: {
default: $LATEST_NPM,
},
pnpm: {
default: $LATEST_PNPM,
},
yarn: {
default: $LATEST_YARN,
transparent: {
default: $LATEST_BERRY,
},
},
},
},
}"
}"

rm config.json
mv config.json.new config.json
rm config.json
mv config.json.new config.json

if [[ ! -z "$(git status --porcelain)" ]]; then
git config user.email '[email protected]'
git config user.name 'Node.js GitHub Bot'
if [[ ! -z "$(git status --porcelain)" ]]; then
git config user.email '[email protected]'
git config user.name 'Node.js GitHub Bot'

git add config.json
git commit -m 'chore: update package manager versions'
git push
fi
git add config.json
git commit -m 'chore: update package manager versions'
git push
fi
Loading