Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

W-12476954: Add workflow to install node #60

Merged
merged 9 commits into from
Feb 2, 2023
22 changes: 22 additions & 0 deletions .github/workflows/install_npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Set Node Version

on: [ workflow_call ]

env:
NODE_VERSION: 16

jobs:
installing_node:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Use Node.js $NODE_VERSION
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Check Node Version
run: node --version
18 changes: 8 additions & 10 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,25 @@ on:
type: string

env:
NODE_OPTIONS: --max_old_space_size=4096
VSCE_PAT: ${{ secrets.VSCE_PAT }}

jobs:
install_npm:
uses: ./.github/workflows/install_npm.yml

build:
runs-on: macos-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
needs: [ install_npm ]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- run: npm install -g vsce
- run: npm ci
- name: Install ALS node client ${{ github.event.inputs.als-version }}
run: npm install @aml-org/als-node-client@${{ github.event.inputs.als-version }}
- name: Check custom dependencies installed
run: npm ls | grep @aml-org
- name: Set package version to latest
run: bash extension-version.sh
- run: npm run build --if-present
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,19 @@ on:
branches: [ master ]

env:
NODE_OPTIONS: --max_old_space_size=4096
VSCE_PAT: ${{ secrets.VSCE_PAT }}

jobs:
install_npm:
uses: ./.github/workflows/install_npm.yml

build:
runs-on: macos-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
needs: [ install_npm ]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- run: npm install -g vsce
- run: npm ci
- name: Set package version to latest
Expand Down
22 changes: 10 additions & 12 deletions .github/workflows/test-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,28 @@ on:
required: true
default: 'latest'
type: string

env:
NODE_OPTIONS: --max_old_space_size=4096

jobs:
install_npm:
uses: ./.github/workflows/install_npm.yml

build:
runs-on: windows-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
needs: [ install_npm ]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- run: npm ci
- name: Install ALS node client ${{ github.event.inputs.als-version }}
run: npm install @aml-org/als-node-client@${{ github.event.inputs.als-version }}
- name: Check custom dependencies installed
run: npm ls | grep @aml-org
- run: npm run build --if-present
- id: test
run: npm run test
continue-on-error: true

- name: Notify slack
id: slack
uses: slackapi/[email protected]
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/test-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,26 @@ name: Service Test CI
on:
repository_dispatch:
types: run-windows

env:
NODE_OPTIONS: --max_old_space_size=4096

jobs:
install_npm:
uses: ./.github/workflows/install_npm.yml

build:
runs-on: windows-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
needs: [ install_npm ]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- run: npm ci
- name: Install ALS node client ${{ github.event.client_payload.version }}
run: npm install @aml-org/als-node-client@${{ github.event.client_payload.version }}
- run: npm run build --if-present
- id: test
run: npm run test
continue-on-error: true

- name: Notify slack
id: slack
uses: slackapi/[email protected]
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,27 @@ on:
pull_request:
types: [opened, reopened, edited, synchronize]
branches: [ master ]

env:
NODE_OPTIONS: --max_old_space_size=4096

jobs:
install_npm:
uses: ./.github/workflows/install_npm.yml

build:
runs-on: windows-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
needs: [ install_npm ]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install ALS Node Client dependency
run: npm i @aml-org/als-node-client
- run: npm ci
- run: npm run build --if-present
- run: npm ls | grep @aml-org
- name: Check custom dependencies installed
run: npm ls | grep @aml-org
- id: test
run: npm run test
continue-on-error: true

- name: Notify slack
id: slack
uses: slackapi/[email protected]
Expand Down