Zobrazenie #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD Pipeline | |
on: | |
push: | |
branches: [ main, master ] | |
pull_request: | |
branches: [ main, master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x, 16.x, 18.x] | |
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 dependencies | |
run: npm install | |
- name: Verify that addon builds | |
run: node -e "require('./addon')" # Simple test to ensure the addon loads without errors | |
# Add more steps here as your project grows | |
# - name: Run tests | |
# run: npm test | |
# Deployment job - add when you're ready to deploy | |
# deploy: | |
# needs: build | |
# runs-on: ubuntu-latest | |
# if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v3 | |
# | |
# - name: Setup Node.js | |
# uses: actions/setup-node@v3 | |
# with: | |
# node-version: '16.x' | |
# | |
# - name: Deploy to hosting service | |
# # Add deployment steps here |