# 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: permissions: contents: write 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 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@fa24774553152dd7873cd16ebd8d959b010c5445 # v4.9.0 with: branch: gh-pages folder: tmp/dist