-
Notifications
You must be signed in to change notification settings - Fork 12
134 lines (114 loc) · 4.39 KB
/
Copy pathci.yml
File metadata and controls
134 lines (114 loc) · 4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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 build dependencies for Lua
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y libreadline-dev
# Install all tools from mise.toml and initialize
- name: Install mise tools
run: |
mise install
mise run init
# 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: |
eval "$(mise env)"
npx nx run-many -t lint test e2e
env:
LUA_PATH: "lib/?.lua;;"
# 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 build dependencies for Lua
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y libreadline-dev
# Install all tools from mise.toml and initialize
- name: Install mise tools
run: |
mise install
mise run init
# 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: |
eval "$(mise env)"
npx nx run-many -t lint test e2e
env:
LUA_PATH: "lib/?.lua;;"
- 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 }}