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

feat(#534): platform specific builds of vsix #612

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/workflows/add-issue-to-project.yml

This file was deleted.

72 changes: 64 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,49 @@ on:

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]

include:
- os: windows-latest
platform: win32
arch: x64
npm_config_arch: x64
- os: windows-latest
platform: win32
arch: arm64
npm_config_arch: arm
- os: ubuntu-latest
platform: linux
arch: x64
npm_config_arch: x64
- os: ubuntu-latest
platform: linux
arch: arm64
npm_config_arch: arm64
- os: ubuntu-latest
platform: linux
arch: armhf
npm_config_arch: arm
- os: ubuntu-latest
platform: alpine
arch: x64
npm_config_arch: x64
- os: macos-latest
platform: darwin
arch: x64
npm_config_arch: x64
- os: macos-latest
platform: darwin
arch: arm64
npm_config_arch: arm64
runs-on: ${{ matrix.os }}
steps:
- name: Clone repository
uses: actions/checkout@v4

- shell: pwsh
run: echo "TARGET=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV

- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -27,16 +60,18 @@ jobs:

- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: "**/node_modules"
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package.json', '**/package-lock.json') }}
key: ${{ runner.os }}-${{ matrix.npm_config_arch }}-node-modules-${{ hashFiles('**/package.json', '**/package-lock.json') }}

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
env:
npm_config_arch: ${{ matrix.npm_config_arch }}

- name: Lint
run: npm run lint
Expand All @@ -52,8 +87,24 @@ jobs:
- name: Build project
run: npm run build

- name: Setup X11
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt update
sudo apt-get install -y \
libglx-mesa0 \
libgl1 \
xvfb \
x11-xserver-utils \
mesa-utils \
x11-utils
echo "DISPLAY=:99.0" >> $GITHUB_ENV
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sleep 3

- name: Run server tests
run: npm run test:codecov
run: npm run test # TODO: fix codecov issue

- name: Run protocol tests
run: npm run test:protocol
Expand All @@ -65,7 +116,7 @@ jobs:
cache-name: cache-vscode
with:
path: .vscode-test
key: ${{ runner.os }}-vscode-1.86.0
key: ${{ matrix.platform }}-${{ matrix.arch }}-vscode-1.86.0

- name: Run E2E tests
uses: coactions/[email protected]
Expand All @@ -78,3 +129,8 @@ jobs:
SOLIDITY_GOOGLE_TRACKING_ID: "dummy-value"
SOLIDITY_SENTRY_DSN: "dummy-value"
run: npm run package
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-${{ matrix.arch }}
path: "client/*.vsix"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Go to [CONTRIBUTING.md](./CONTRIBUTING.md) to learn about how to set up the exte

[Hardhat Support Discord server](https://hardhat.org/discord): for questions and feedback.

[Follow Hardhat on Twitter.](https://twitter.com/HardhatHQ)
[Follow Hardhat on X (formerly Twitter)](https://x.com/HardhatHQ)
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"prettier": "prettier *.json \"src/**/*.{ts,js,md,json,yml}\"",
"clean": "rimraf out tmp tsconfig.tsbuildinfo",
"prepackage": "npm run clean && node scripts/bundle.js",
"package": "cd ./tmp && vsce package --no-dependencies --no-yarn -o ..",
"package": "cross-env-shell \"cd ./tmp && vsce package --no-dependencies --no-yarn --target $TARGET -o ..\"",
"postpackage": "rimraf ./tmp"
},
"devDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.