Skip to content

Commit

Permalink
github actions: 添加 npm-run-electron.yml,用于测试运行 npm run electron 命令。
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 committed Nov 18, 2024
1 parent ce6e73d commit bcdeeaf
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/npm-run-electron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: npm run electron

on:
push:
branches:
- run

jobs:
npm-run-electron:
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os:
- windows
- ubuntu
- macos
node:
- 22
steps:
- name: Checkout
uses: actions/[email protected]

- name: 'Setup Node.js "${{ matrix.node }}.x" environment'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
registry-url: https://npm.pkg.github.com/

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Python environment (Mac) Because of electron-builder install-app-deps requires Python setup tools
if: matrix.os == 'macos'
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Get package info
id: package-info
uses: luizfelipelaviola/get-package-info@v1
with:
path: ./packages/mitmproxy

- name: Print
run: |
echo "version = ${{ steps.package-info.outputs.version }}";
echo "github.ref_type = ${{ github.ref_type }}";
echo "github.ref = ${{ github.ref }}";
echo "github.ref_name = ${{ github.ref_name }}";
- name: 'npm -v | pnpm -v | python --version'
run: |
echo "======================================================================";
echo "npm -v";
echo "--------------------";
npm -v;
echo "======================================================================";
echo "pnpm -v";
echo "--------------------";
pnpm -v;
echo "======================================================================";
echo "python --version";
echo "--------------------";
python --version;
- name: pnpm install
run: |
echo "======================================================================";
dir || ls -lah;
echo "======================================================================";
echo "pnpm install";
echo "--------------------";
pnpm install;
- name: 'npm run electron'
run: |
echo "======================================================================";
echo "cd packages/gui";
echo "--------------------";
cd packages/gui;
dir || ls -lah;
echo "======================================================================";
echo "npm run electron";
echo "--------------------";
npm run electron;

0 comments on commit bcdeeaf

Please sign in to comment.