Skip to content

Commit 4e231eb

Browse files
authored
Add test workflow (#2)
1 parent 6cad403 commit 4e231eb

File tree

3 files changed

+114
-0
lines changed

3 files changed

+114
-0
lines changed

.github/workflows/test-linux.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Test linux workflow
2+
3+
on:
4+
pull_request:
5+
push:
6+
schedule:
7+
- cron: 0 0 * * 5
8+
9+
jobs:
10+
plugin-test-linux:
11+
strategy:
12+
matrix:
13+
# ref: https://github.com/actions/runner-images
14+
os: [ubuntu-latest]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
- name: install vfox (Linux)
20+
run: |
21+
echo "deb [trusted=yes] https://apt.fury.io/versionfox/ /" | sudo tee /etc/apt/sources.list.d/versionfox.list
22+
sudo apt-get update
23+
sudo apt-get install vfox
24+
25+
- name: Install packages
26+
run: sudo apt-get update && sudo apt-get install -y autoconf bison build-essential curl gettext git libgd-dev libcurl4-openssl-dev libedit-dev libicu-dev libjpeg-dev libmysqlclient-dev libonig-dev libpng-dev libpq-dev libreadline-dev libsqlite3-dev libssl-dev libxml2-dev libzip-dev openssl pkg-config re2c zlib1g-dev
27+
28+
- name: Generate PHP plugin
29+
run: |
30+
zip -r php.zip ./
31+
32+
- name: Test
33+
run: |
34+
vfox add -s php.zip
35+
vfox install php@latest
36+
vfox use -p php@$(vfox list php | sed -n 's/-> v//p')
37+
eval "$(vfox activate bash)"
38+
php -v
39+
php -m
40+
composer -V

.github/workflows/test-macos.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Test macos workflow
2+
3+
on:
4+
pull_request:
5+
push:
6+
schedule:
7+
- cron: 0 0 * * 5
8+
9+
jobs:
10+
plugin-test-macos:
11+
strategy:
12+
matrix:
13+
# ref: https://github.com/actions/runner-images
14+
os: [macos-latest]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
- name: install vfox (MacOS)
20+
run: |
21+
brew tap version-fox/tap
22+
brew install vfox
23+
24+
- name: Generate PHP plugin
25+
run: |
26+
zip -r php.zip ./
27+
28+
- name: Install packages
29+
run: brew install autoconf automake bison freetype gd gettext icu4c krb5 libedit libiconv libjpeg libpng libxml2 libzip pkg-config re2c zlib
30+
31+
- name: Test
32+
shell: bash
33+
run: |
34+
vfox add -s php.zip
35+
vfox install php@latest
36+
vfox use -p php@$(vfox list php | sed -n 's/-> v//p')
37+
eval "$(vfox activate bash)"
38+
php -v
39+
php -m
40+
composer -V
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test windows workflow
2+
3+
on:
4+
pull_request:
5+
push:
6+
schedule:
7+
- cron: 0 0 * * 5
8+
9+
jobs:
10+
plugin-test-windows:
11+
strategy:
12+
matrix:
13+
# ref: https://github.com/actions/runner-images
14+
os: [windows-latest]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: install vfox and test (Windows)
21+
shell: pwsh
22+
run: |
23+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
24+
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
25+
scoop install vfox
26+
Compress-Archive -Path .\* -DestinationPath .\php.zip
27+
vfox -v
28+
vfox add -s php.zip
29+
vfox install php@latest
30+
vfox use -p php@$(vfox list php | sed -n 's/-> v//p')
31+
Invoke-Expression "$(vfox activate pwsh)"
32+
php -v
33+
php -m
34+
composer -V

0 commit comments

Comments
 (0)