Skip to content

Dev

Dev #62

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
permissions:
actions: read
contents: write
pull-requests: write
id-token: write
jobs:
# Prerelease job - runs on PR creation/updates only
prerelease:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && contains(fromJSON('["opened", "synchronize", "reopened"]'), github.event.action)
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
# Install mise
- name: Install mise
run: |
curl https://mise.run | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install nix
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
accept-flake-config = true
# Install Lua and busted via apt (workaround for mise lua plugin luarocks 3.13.0 bug)
- name: Install Lua and busted
run: |
sudo apt-get update
sudo apt-get install -y lua5.4 liblua5.4-dev luarocks
sudo luarocks install busted
# Link the nix plugin (skip mise init task to avoid lua installation)
- name: Link nix plugin
run: mise plugin link nix $PWD --force
# Install only node and nix:shellspec (lua/busted installed via apt)
- name: Install mise tools
run: mise install node nix:shellspec
# Install VSCode and virtual display for extension tests
- name: Install VSCode and dependencies
run: |
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt update
sudo apt install -y code xvfb
- run: npm ci --legacy-peer-deps
# Run tests and build
- name: Run tests
run: npx nx run-many -t lint test e2e
# Release job - runs only when MR is merged to main
release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && contains(github.event.head_commit.message, 'Merge pull request')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
# Install mise
- name: Install mise
run: |
curl https://mise.run | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install nix
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
accept-flake-config = true
# Install Lua and busted via apt (workaround for mise lua plugin luarocks 3.13.0 bug)
- name: Install Lua and busted
run: |
sudo apt-get update
sudo apt-get install -y lua5.4 liblua5.4-dev luarocks
sudo luarocks install busted
# Link the nix plugin (skip mise init task to avoid lua installation)
- name: Link nix plugin
run: mise plugin link nix $PWD --force
# Install only node and nix:shellspec (lua/busted installed via apt)
- name: Install mise tools
run: mise install node nix:shellspec
# Install VSCode and virtual display for extension tests
- name: Install VSCode and dependencies
run: |
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt update
sudo apt install -y code xvfb
- run: npm ci --legacy-peer-deps
# Run tests and build
- name: Run tests
run: npx nx run-many -t lint test e2e
- name: Create release
run: |
# Configure git
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Use nx release - handles versioning, changelog, and GitHub release
npx nx release --yes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}