Skip to content

Commit

Permalink
chore: e2e tests check vfox use
Browse files Browse the repository at this point in the history
  • Loading branch information
yeshan333 committed Apr 10, 2024
1 parent 0a7851d commit c29ac5b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/e2e_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@ jobs:
echo "deb [trusted=yes] https://apt.fury.io/versionfox/ /" | sudo tee /etc/apt/sources.list.d/versionfox.list
sudo apt-get update
sudo apt-get install vfox
echo 'eval "$(vfox activate bash)"' >> ~/.bashrc
- name: install vfox (MacOS)
if: runner.os == 'MacOS'
run: |
brew tap version-fox/tap
brew install vfox
echo 'eval "$(vfox activate bash)"' >> ~/.bashrc
echo 'eval "$(vfox activate zsh)"' >> ~/.zshrc
- name: install scoop (Windows)
if: runner.os == 'Windows'
Expand All @@ -44,29 +41,35 @@ jobs:
run: |
vfox add --source https://github.com/version-fox/vfox-etcd/archive/refs/heads/main.zip etcd
- name: install Etcd by vfox-etcd plugin (Linux)
- name: install etcd by vfox-etcd plugin (Linux)
if: runner.os == 'Linux'
run: |
vfox install [email protected]
vfox use -g [email protected]
eval "$(vfox activate bash)"
echo "===============PATH==============="
echo $PATH
echo "===============PATH==============="
etcd -version
- name: install Etcd by vfox-etcd plugin (Darwin)
- name: install etcd by vfox-etcd plugin (Darwin)
if: runner.os == 'MacOS'
run: |
vfox install [email protected]
vfox use -g [email protected]
eval "$(vfox activate bash)"
echo "===============PATH==============="
echo $PATH
echo "===============PATH==============="
etcd -version
- name: install Etcd by vfox-etcd plugin (Windows)
- name: install etcd by vfox-etcd plugin (Windows)
if: runner.os == 'Windows'
run: |
vfox install [email protected]
vfox use -g [email protected]
Invoke-Expression "$(vfox activate pwsh)"
echo "===============PATH==============="
echo $env:PATH
echo "===============PATH==============="
echo "===============PATH==============="
etcd -version
13 changes: 8 additions & 5 deletions .github/workflows/update_etcd_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
contents: write

jobs:
build:
update_etcd_versions:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
Expand All @@ -30,7 +30,10 @@ jobs:
pwd
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"github-actions[bot]
git status -s
git add .
git commit -m "chore(versions.txt): update Etcd version file"
git push https://github-actions[bot]:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
if [[ -n $(git status -s) ]]; then
git add .
git commit -m "chore(versions.txt): update etcd version file"
git push https://github-actions[bot]:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
else
echo "never updated."
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vfox-etcd plugin

Etcd [vfox](https://github.com/version-fox) plugin. Use the vfox to manage multiple Etcd versions in Linux/Darwin/Windows.
etcd [vfox](https://github.com/version-fox) plugin. Use the vfox to manage multiple etcd versions in Linux/Darwin/Windows.

## Usage

Expand Down
4 changes: 2 additions & 2 deletions assets/get_all_etcd_versions.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json
import requests

# fetch version: -> https://api.github.com/repos/etcd-io/etcd/tags?per_page=100?sort=pushed
# fetch version: -> https://api.github.com/repos/etcd-io/etcd/tags?per_page=100&sort=pushed
# github api has rate limt
# prefer use local version file
def update_all_version_from_github_api():
url = "https://api.github.com/repos/etcd-io/etcd/tags?per_page=100?sort=pushed"
url = "https://api.github.com/repos/etcd-io/etcd/tags?per_page=100&sort=pushed"
response = requests.get(url)
data = response.json()
print(data)
Expand Down
2 changes: 1 addition & 1 deletion metadata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PLUGIN.homepage = "https://github.com/version-fox/vfox-etcd"
--- Plugin license, please choose a correct license according to your needs.
PLUGIN.license = "Apache 2.0"
--- Plugin description
PLUGIN.description = "Etcd vfox plugin, support for managing multiple Etcd versions."
PLUGIN.description = "etcd vfox plugin, support for managing multiple etcd versions."


--- !!! OPTIONAL !!!
Expand Down

0 comments on commit c29ac5b

Please sign in to comment.