Skip to content

chore: resolve clippy warning on Windows #383

chore: resolve clippy warning on Windows

chore: resolve clippy warning on Windows #383

Workflow file for this run

name: Release NodeJS Package
on:
workflow_dispatch:
pull_request:
push:
branches: [ master, develop ]
paths:
- '.github/workflows/release-nodejs.yml'
- 'source/ports/node_port/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: NodeJS Port Tests (${{ matrix.os }}, ${{ matrix.build }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
build: [debug, release]
exclude:
# Windows distributable ships release-only builds
- os: windows-latest
build: debug
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install MetaCall (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
FLAGS="${{ matrix.build == 'debug' && '-s -- --debug' || '' }}"
curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh $FLAGS
- name: Install MetaCall (Windows)
if: runner.os == 'Windows'
run: powershell -NoProfile -ExecutionPolicy Unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://raw.githubusercontent.com/metacall/install/master/install.ps1')))"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Fix npm cache permissions (macOS)
if: runner.os == 'macOS'
run: sudo chown -R 501:20 "/Users/runner/.npm"
- name: Install Dependencies
working-directory: source/ports/node_port
run: npm install
# Single unified copy step
- name: Populate scripts directory
shell: bash
run: |
mkdir -p source/ports/node_port/scripts
# Python scripts
cp source/scripts/python/helloworld/source/helloworld.py source/ports/node_port/scripts/
cp source/scripts/python/ducktype/source/ducktype.py source/ports/node_port/scripts/
cp source/scripts/python/example/source/example.py source/ports/node_port/scripts/
cp source/scripts/python/classname/source/classname.py source/ports/node_port/scripts/
cp source/scripts/python/function/source/function.py source/ports/node_port/scripts/
# Ruby scripts
cp source/scripts/ruby/ducktype/source/ducktype.rb source/ports/node_port/scripts/
cp source/scripts/ruby/cache/source/cache.rb source/ports/node_port/scripts/
# TypeScript badrequire package (directory copy)
cp -r source/scripts/typescript/badrequire/source/badrequire \
source/ports/node_port/scripts/badrequire
- name: Test the NodeJS Port (Unix)
if: runner.os != 'Windows'
working-directory: source/ports/node_port
env:
LOADER_SCRIPT_PATH: ${{ github.workspace }}/source/ports/node_port/scripts
run: node test.js
- name: Test the NodeJS Port (Windows)
if: runner.os == 'Windows'
working-directory: source/ports/node_port
env:
LOADER_SCRIPT_PATH: ${{ github.workspace }}\source\ports\node_port\scripts
run: metacall node test.js
release:
name: Release NodeJS Port
runs-on: ubuntu-latest
needs: test
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Release the port
working-directory: source/ports/node_port
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: ./upload.sh