Skip to content

Commit 8ac217b

Browse files
yeshan333claude
andauthored
ci: add MCP config and Mise E2E tests workflow (#13)
* feat: add MCP config and Mise E2E tests workflow * fix: Update mise E2E test workflow to properly set PATH - Add proper PATH setup for mise commands - Separate installation and verification steps - Ensure PATH is correctly configured for all platforms - Fix Windows PATH configuration syntax This ensures that mise commands can be found and executed properly in the GitHub Actions workflow. 🤖 Generated with [Claude Code] Co-Authored-By: Claude <noreply@anthropic.com> * fix: Remove Windows tests from mise E2E workflow - Remove Windows platform from test matrix - Remove all Windows-specific test steps - Keep only Linux and macOS tests This simplifies the workflow and focuses on the core platforms. 🤖 Generated with [Claude Code] Co-Authored-By: Claude <noreply@anthropic.com> * fix: Update E2E test workflows for mise integration - Add paths filter to e2e_test.yaml to only run when lib files change - Update mise_e2e_test.yaml to use correct mise activation command - Remove redundant plugin setup steps - Use --shims flag for proper mise activation These changes ensure the workflows run efficiently and correctly test mise integration. 🤖 Generated with [Claude Code] Co-Authored-By: Claude <noreply@anthropic.com> * docs: Add conversation export for mise E2E tests implementation - Include exported conversation for reference - Document the implementation process 🤖 Generated with [Claude Code] Co-Authored-By: Claude <noreply@anthropic.com> * fix: Add paths filter to pull_request triggers in E2E workflows - Add paths: ['lib'] to pull_request section in both e2e_test.yaml and mise_e2e_test.yaml - This ensures workflows only run on PRs when lib files change - Consistent with push trigger configuration 🤖 Generated with [Claude Code] Co-Authored-By: Claude <noreply@anthropic.com> * fix: Remove pre-built Elixir installation test from mise workflow - Remove the test for installing pre-built Elixir versions from hex.pm - Keep only the core Elixir installation tests - Simplify the workflow to focus on main functionality 🤖 Generated with [Claude Code] Co-Authored-By: Claude <noreply@anthropic.com> * build: remove redundant path config for PR checks * ci: update E2E test workflow names and README badges --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 57409b9 commit 8ac217b

6 files changed

Lines changed: 1323 additions & 7 deletions

File tree

.claude/add_misetest.txt

Lines changed: 1141 additions & 0 deletions
Large diffs are not rendered by default.

.claude/mcp.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mcpServers": {
3+
"chrome": {
4+
"type": "http",
5+
"url": "http://127.0.0.1:12306/mcp"
6+
}
7+
}
8+
}

.github/workflows/e2e_test.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
name: E2E tests
1+
name: vfox E2E tests
22

33
on:
44
push:
55
branches: [main]
6+
paths: ['lib']
67
pull_request:
8+
paths: ['lib']
79
workflow_dispatch:
810
schedule:
911
# Runs at 12am UTC
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: mise E2E tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ['lib']
7+
pull_request:
8+
paths: ['lib']
9+
workflow_dispatch:
10+
schedule:
11+
# Runs at 12am UTC
12+
- cron: '0 0 * * *'
13+
14+
jobs:
15+
mise_e2e_tests:
16+
strategy:
17+
matrix:
18+
# ref: https://github.com/actions/runner-images
19+
os: [ubuntu-22.04, macos-13]
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install mise (Unix-like)
25+
if: runner.os != 'Windows'
26+
run: |
27+
curl https://mise.run | sh
28+
echo "$HOME/.local/bin" >> $GITHUB_PATH
29+
source ~/.bashrc || true
30+
31+
- name: Verify mise installation (Unix-like)
32+
if: runner.os != 'Windows'
33+
run: |
34+
export PATH="$HOME/.local/bin:$PATH"
35+
mise --version
36+
37+
- name: Install Erlang/OTP & Elixir via mise (Linux)
38+
if: runner.os == 'Linux'
39+
run: |
40+
sudo apt-get update -y
41+
sudo apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk
42+
export MAKEFLAGS=-j4
43+
export PATH="$HOME/.local/bin:$PATH"
44+
45+
# Install via mise
46+
mise install vfox:version-fox/vfox-erlang@26.2.3
47+
mise use -g vfox:version-fox/vfox-erlang@26.2.3
48+
eval "$(mise activate bash --shims)"
49+
which erl
50+
echo "===============PATH==============="
51+
echo $PATH
52+
echo "===============PATH==============="
53+
54+
mise install vfox:version-fox/vfox-elixir@1.16.2
55+
mise use -g vfox:version-fox/vfox-elixir@1.16.2
56+
eval "$(mise activate bash --shims)"
57+
elixirc -v
58+
cd assets
59+
elixir hello.ex
60+
61+
62+
- name: Install Erlang/OTP & Elixir via mise (macOS)
63+
if: runner.os == 'macOS'
64+
run: |
65+
brew install autoconf libxslt fop wxwidgets openssl
66+
export MAKEFLAGS=-j4
67+
export PATH="$HOME/.local/bin:$PATH"
68+
69+
# Install via mise
70+
mise install vfox:version-fox/vfox-erlang@26.2.3
71+
mise use -g vfox:version-fox/vfox-erlang@26.2.3
72+
eval "$(mise activate bash)"
73+
which erl
74+
echo "===============PATH==============="
75+
echo $PATH
76+
echo "===============PATH==============="
77+
78+
mise install vfox:version-fox/vfox-elixir@1.16.2
79+
mise use -g vfox:version-fox/vfox-elixir@1.16.2
80+
eval "$(mise activate bash)"
81+
elixirc -v
82+
cd assets
83+
elixir hello.ex

CLAUDE.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
This is a vfox plugin for managing multiple Elixir versions across Windows, Linux, and macOS platforms. The plugin integrates with vfox (version-fox), a universal SDK version management tool.
8+
9+
## Code Architecture and Structure
10+
11+
- **Plugin Entry Point**: `metadata.lua` - Contains plugin metadata like name, version, and compatibility requirements
12+
- **Core Logic**: `lib/elixir_utils.lua` - Utility functions for version management, HTTP requests, and platform-specific operations
13+
- **Hook System**: The `hooks/` directory contains Lua files that implement the vfox plugin interface:
14+
- `available.lua` - Lists available Elixir versions
15+
- `pre_install.lua` - Handles version validation and download URL generation
16+
- `post_install.lua` - Performs post-installation tasks like compilation
17+
- `pre_use.lua` - Validates version before activation
18+
- `env_keys.lua` - Configures environment variables for installed versions
19+
20+
## Common Development Commands
21+
22+
### Testing
23+
24+
```bash
25+
# The project uses GitHub Actions for E2E testing across platforms
26+
# Tests are defined in .github/workflows/e2e_test.yaml
27+
28+
# Mise E2E tests are defined in .github/workflows/mise_e2e_test.yaml
29+
30+
# To run tests locally, you would need to:
31+
# 1. Install vfox or mise
32+
# 2. Add the plugin
33+
# 3. Install and test Elixir versions
34+
```
35+
36+
### Version Management
37+
38+
```bash
39+
# Update Elixir versions list
40+
# Done via GitHub Actions workflow in .github/workflows/update_elixir_versions.yaml
41+
42+
# The versions are stored in assets/versions.txt (Unix) and assets/versions_win.txt (Windows)
43+
```
44+
45+
## Key Implementation Details
46+
47+
1. **Multi-platform Support**: The plugin handles different installation methods for Windows (pre-built installers) and Unix-like systems (source compilation)
48+
49+
2. **Mirror Support**: Can install from official Elixir releases or pre-built versions from hex.pm (controlled by VFOX_ELIXIR_MIRROR environment variable)
50+
51+
3. **Dependency Management**: Requires Erlang/OTP to be installed before Elixir installation
52+
53+
4. **Installation Process**:
54+
- Unix/Linux: Downloads source code and compiles with `make`
55+
- Windows: Downloads and executes official installer
56+
- Hex mirror: Downloads pre-built binaries
57+
58+
## Plugin Interface
59+
60+
The plugin implements the standard vfox plugin interface through the hook files:
61+
62+
- `PLUGIN:Available()` - Returns list of available versions
63+
- `PLUGIN:PreInstall()` - Prepares for installation
64+
- `PLUGIN:PostInstall()` - Performs post-installation tasks
65+
- `PLUGIN:PreUse()` - Validates before version activation
66+
- `PLUGIN:EnvKeys()` - Sets up environment variables
67+
68+
This architecture allows the plugin to integrate seamlessly with vfox's version management system while handling the specific requirements of Elixir installation across different platforms.

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
![logo](./assets/vfox-elixir-logo.png)
44

5-
[![E2E tests](https://github.com/version-fox/vfox-elixir/actions/workflows/e2e_test.yaml/badge.svg)](https://github.com/version-fox/vfox-elixir/actions/workflows/e2e_test.yaml)
5+
[![vfox E2E tests](https://github.com/version-fox/vfox-elixir/actions/workflows/e2e_test.yaml/badge.svg)](https://github.com/version-fox/vfox-elixir/actions/workflows/e2e_test.yaml)
6+
[![mise E2E tests](https://github.com/version-fox/vfox-elixir/actions/workflows/mise_e2e_test.yaml/badge.svg)](https://github.com/version-fox/vfox-elixir/actions/workflows/mise_e2e_test.yaml)
67

78
</div>
89

@@ -14,7 +15,7 @@ Elixir [vfox](https://github.com/version-fox) plugin. Use the vfox to manage mul
1415

1516
```shell
1617
# install plugin
17-
vfox add --source https://github.com/version-fox/vfox-elixir/archive/refs/heads/main.zip elixir
18+
vfox add elixir
1819

1920
# install an available version
2021
vfox search elixir
@@ -39,12 +40,12 @@ Here are two examples of installing on Ubuntu 20.04 and MacOS 13.
3940
sudo apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk
4041

4142
# install Erlang/OTP
42-
vfox add --source https://github.com/version-fox/vfox-erlang/archive/refs/heads/main.zip erlang
43+
vfox add erlang
4344
vfox install erlang@26.2.3
4445
vfox use -g erlang@26.2.3
4546

4647
# install Elixir
47-
vfox add --source https://github.com/version-fox/vfox-elixir/archive/refs/heads/main.zip elixir
48+
vfox add elixir
4849
vfox install elixir@1.16.2
4950
vfox use -g elixir@1.16.2
5051
```
@@ -58,12 +59,12 @@ You can reference the E2E test in Ubuntu 20.04: [https://github.com/version-fox/
5859
brew install autoconf libxslt fop wxwidgets openssl
5960

6061
# install Erlang/OTP
61-
vfox add --source https://github.com/version-fox/vfox-erlang/archive/refs/heads/main.zip erlang
62+
vfox add erlang
6263
vfox install erlang@26.2.3
6364
vfox use -g erlang@26.2.3
6465

6566
# install Elixir
66-
vfox add --source https://github.com/version-fox/vfox-elixir/archive/refs/heads/main.zip elixir
67+
vfox add elixir
6768
vfox install elixir@1.16.2
6869
vfox use -g elixir@1.16.2
6970
```
@@ -104,3 +105,16 @@ Please select a version of elixir to install [type to search]:
104105

105106
(1) > VFOX_ELIXIR_MIRROR=hex vfox install elixir@main-otp-26
106107
```
108+
109+
## Usage with mise
110+
111+
The plugin can also be used with [mise](https://mise.jdx.dev/), a development tool manager:
112+
113+
```shell
114+
# Elixir need Erlang/OTP, so install Erlang/OTP first
115+
mise install vfox:version-fox/vfox-erlang@26.2.3
116+
mise use -g vfox:version-fox/vfox-erlang@26.2.3
117+
118+
# Install an available version
119+
mise install vfox:version-fox/vfox-elixir@1.16.2
120+
```

0 commit comments

Comments
 (0)