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 897de7f commit 7ac86ef
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 28 deletions.
30 changes: 8 additions & 22 deletions .github/workflows/e2e_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,47 +33,33 @@ jobs:
vfox add --source https://github.com/version-fox/vfox-erlang/archive/refs/heads/main.zip erlang
vfox add --source https://github.com/version-fox/vfox-elixir/archive/refs/heads/main.zip elixir
- name: install Erlang/OTP by vfox-erlang plugin (Linux)
- name: install Erlang/OTP & Elixir by vfox-erlang & vfox-elixir plugin (Darwin)
if: runner.os == 'Linux'
run: |
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
echo 'eval "$(vfox activate bash)"' >> ~/.bashrc
source ~/.bashrc
vfox install erlang@26.2.3
vfox use -g erlang@26.2.3
eval "$(vfox activate bash)"
erlc -help
echo "===============PATH==============="
echo $PATH
echo "===============PATH==============="
vfox install elixir@1.16.2
vfox use -g elixir@1.16.2
elixirc -v
- name: install Erlang/OTP by vfox-erlang plugin (Darwin)
- name: install Erlang/OTP & Elixir by vfox-erlang & vfox-elixir plugin (Darwin)
if: runner.os == 'MacOS'
run: |
brew install autoconf libxslt fop wxwidgets openssl
echo 'eval "$(vfox activate bash)"' >> ~/.bashrc
source ~/.bashrc
vfox install erlang@26.2.3
vfox use -g erlang@26.2.3
eval "$(vfox activate bash)"
erlc -help
echo "===============PATH==============="
echo $PATH
echo "===============PATH==============="
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/erl /usr/local/bin/erl
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/escript /usr/local/bin/escript
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/start_clean.script /usr/local/bin/start_clean.script
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/ct_run /usr/local/bin/ct_run
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/no_dot_erlang.boot /usr/local/bin/no_dot_erlang.boot
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/dialyzer /usr/local/bin/dialyzer
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/no_dot_erlang.script /usr/local/bin/no_dot_erlang.script
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/erl /usr/local/bin/erl
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/start.boot /usr/local/bin/start.boot
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/typer /usr/local/bin/typer
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/erl_call /usr/local/bin/erl_call
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/start.script /usr/local/bin/start.script
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/erlc /usr/local/bin/erlc
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/start_clean.boot /usr/local/bin/start_clean.boot
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/start_sasl.boot /usr/local/bin/start_sasl.boot
ln -sf ~/.version-fox/cache/erlang/v-26.2.3/erlang-26.2.3/bin/start_sasl.script /usr/local/bin/start_sasl.script
vfox install elixir@1.16.2
vfox use -g elixir@1.16.2
elixirc -v
11 changes: 7 additions & 4 deletions .github/workflows/update_elixir_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 Elixir 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 Elixir version file"
git push https://github-actions[bot]:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
else
echo "never updated."
fi
4 changes: 2 additions & 2 deletions assets/get_all_elixir_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/elixir-lang/elixir/tags?per_page=100?sort=pushed
# fetch version: -> https://api.github.com/repos/elixir-lang/elixir/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/elixir-lang/elixir/tags?per_page=100?sort=pushed"
url = "https://api.github.com/repos/elixir-lang/elixir/tags?per_page=100&sort=pushed"
response = requests.get(url)
data = response.json()
print(data)
Expand Down

0 comments on commit 7ac86ef

Please sign in to comment.