Skip to content

Commit

Permalink
Add test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Chance-fyi committed Apr 10, 2024
1 parent 8e5b285 commit aaa814f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test workflow

on:
pull_request:
push:
schedule:
- cron: 0 0 * * 5

jobs:
plugin-test-linux:
runs-on: ubuntu-latest
steps:
- name: Install vfox
run: |
echo "deb [trusted=yes] https://apt.fury.io/versionfox/ /" | tee /etc/apt/sources.list.d/versionfox.list
apt-get update
apt-get install vfox
- name: View vfox version
run: |
vfox -v
vfox available
- name: Checkout code
uses: actions/checkout@v3

- name: Add PHP plugin
run: |
mkdir ~/.version-fox/plugin/php
cp -r ./* ~/.version-fox/plugin/php
- name: Search PHP version
run: |
vfox search php &
sleep 3
- name: Install packages
run: apt-get install -y locate libgd-dev libjpeg-dev libpng-dev libonig-dev libzip-dev

- name: Install PHP
run: |
vfox i php
export __VFOX_SHELL="$$"
vfox use php@$(vfox list php | sed -n 's/-> v//p')
eval "$(vfox env -s bash)"
php -v
php -m
composer -V
1 change: 1 addition & 0 deletions hooks/post_install.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function InstallComposerForWin(path)
end

function CompileInstallPHP(path)
RUNTIME.pluginDirPath = '~/.version-fox/plugin/php'
os.execute('chmod +x ' .. RUNTIME.pluginDirPath .. '/bin/install')
local code = os.execute(RUNTIME.pluginDirPath .. '/bin/install ' .. path)
if code ~= 0 then
Expand Down

0 comments on commit aaa814f

Please sign in to comment.