mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2026-10-25 15:05:25 +00:00
69 lines
2.6 KiB
YAML
69 lines
2.6 KiB
YAML
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
|
|
name: Node.js CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
# Testers can build an installable VSIX from any branch on demand.
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [24.x]
|
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: 'npm'
|
|
- name: Get extension version
|
|
id: version
|
|
run: echo "version=$(node -p 'require("./extension/package.json").version')" >> "$GITHUB_OUTPUT"
|
|
- run: git submodule init
|
|
- run: git submodule update
|
|
- run: npm ci --no-audit --legacy-peer-deps
|
|
- run: npm run build --if-present
|
|
- run: npm test
|
|
env:
|
|
TEST8BIT_GITHUB_TOKEN: ${{ secrets.TEST8BIT_GITHUB_TOKEN }}
|
|
- run: npm run test-verilog
|
|
- run: npm run buildpresets
|
|
- run: make distro
|
|
- name: Build and test VS Code extension
|
|
run: |
|
|
npm ci --no-audit --legacy-peer-deps --prefix extension
|
|
npm run typecheck --prefix extension
|
|
npm test --prefix extension
|
|
# Package the extension with the toolchain packs bundled, so testers can
|
|
# install it from the artifact with no other setup.
|
|
- name: Package VS Code extension
|
|
if: github.event_name != 'pull_request'
|
|
run: |
|
|
npm run package:release --prefix extension
|
|
mv extension/*.vsix "extension/8bitworkshop-vscode-${{ steps.version.outputs.version }}-${{ github.run_number }}.vsix"
|
|
# Upload the VSIX as-is; it is already an archive, so GitHub need not zip it again.
|
|
- name: Upload VS Code extension
|
|
if: github.event_name != 'pull_request'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: 8bitworkshop-vscode-${{ steps.version.outputs.version }}-${{ github.run_number }}
|
|
path: extension/8bitworkshop-vscode-*.vsix
|
|
archive: false
|
|
if-no-files-found: error
|
|
retention-days: 30
|
|
- name: Deploy
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
uses: JamesIves/github-pages-deploy-action@v4.9.0
|
|
with:
|
|
branch: gh-pages
|
|
folder: tmp/dist
|