Skip to content

Commit

Permalink
Update ci-repo.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hhpatel14 authored Dec 3, 2024
1 parent c91be66 commit 5bdb372
Showing 1 changed file with 120 additions and 11 deletions.
131 changes: 120 additions & 11 deletions .github/workflows/ci-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,135 @@ on:
branches:
- "*" # Trigger on pull requests targeting the master branch

concurrency:
group: ci-repo-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

# https://typicode.github.io/husky/how-to.html#ci-server-and-docker
env:
HUSKY: 0

jobs:
build:
name: Build (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
arch: linux
- os: macos-latest
arch: macos
- os: windows-latest
arch: windows
max-parallel: 3

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"

- name: Install workspace dependencies
run: |
npm ci
- name: Lint sources
run: |
npm run lint
- name: Build
run: |
npm run build
test:
name: Run Tests
runs-on: ubuntu-latest # Use Ubuntu for the runner
name: Test (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
include:
- os: ubuntu-latest
arch: linux
- os: macos-latest
arch: macos
- os: windows-latest
arch: windows

steps:
# Step 1: Checkout the code
- name: Checkout code
uses: actions/checkout@v4

# Step 2: Set up Node.js
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "16" # Specify the Node.js version
node-version-file: ".nvmrc"
cache: "npm"

# Step 3: Install dependencies
- name: Install dependencies
run: npm install
- name: Install workspace dependencies
run: |
npm ci
# Step 4: Compile the project
- name: Compile the project
run: npm run compile
# Run tests on Linux
- name: Run tests (Linux)
if: matrix.arch == 'linux'
run: xvfb-run -a npm test

# Run tests on macOS
- name: Run tests (macOS)
if: matrix.arch == 'macos'
run: npm test

# Run tests on Windows
- name: Run tests (Windows)
if: matrix.arch == 'windows'
shell: cmd
run: npm test

package:
name: Package (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
needs: test
strategy:
matrix:
include:
- os: ubuntu-latest
arch: linux
- os: macos-latest
arch: macos
- os: windows-latest
arch: windows
max-parallel: 3

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"

- name: Install workspace dependencies
run: |
npm ci
- name: Build the project and generate the .vsix
run: |
npm run build
npm run collect-assets
npm run dist
npm run package
- name: Upload VSIX artifact
uses: actions/upload-artifact@v4
with:
name: vscode-extension-${{ matrix.arch }}
path: "dist/*.vsix"

0 comments on commit 5bdb372

Please sign in to comment.