-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
53 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.x, 20.x] | ||
node-version: [16.x, 18.x, 20.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -55,28 +55,70 @@ jobs: | |
|
||
- name: Test create-site command | ||
run: | | ||
mkdir -p test-sites | ||
pageforge create-site test-sites/test-site | ||
test -d test-sites/test-site || exit 1 | ||
mkdir -p test-sites/create-site-test | ||
pageforge create-site test-sites/create-site-test | ||
test -d test-sites/create-site-test || exit 1 | ||
- name: Test init command | ||
- name: Test init command in new directory | ||
run: | | ||
cd test-sites/test-site | ||
mkdir -p test-sites/init-test | ||
cd test-sites/init-test | ||
pageforge init | ||
test -f pageforge.yml || exit 1 | ||
- name: Test build command | ||
- name: Test build command in new directory | ||
run: | | ||
cd test-sites/test-site | ||
mkdir -p test-sites/build-test | ||
cd test-sites/build-test | ||
pageforge create-site . | ||
pageforge build | ||
test -d dist || exit 1 | ||
- name: Test serve command | ||
- name: Test serve command in new directory | ||
run: | | ||
cd test-sites/test-site | ||
mkdir -p test-sites/serve-test | ||
cd test-sites/serve-test | ||
pageforge create-site . | ||
timeout 30s pageforge serve --port 3001 & | ||
sleep 5 | ||
curl -f http://localhost:3001 || exit 1 | ||
- name: Build project | ||
run: pnpm run build || echo "No build script found" | ||
run: pnpm run build || echo "No build script found" | ||
|
||
test-deploy: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Link package globally | ||
run: | | ||
pnpm link --global | ||
pnpm link --global pageforge | ||
- name: Test deploy-github command | ||
run: | | ||
mkdir -p test-sites/deploy-test | ||
cd test-sites/deploy-test | ||
pageforge create-site . | ||
pageforge build | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Test User" | ||
git init | ||
git add . | ||
git commit -m "Initial commit" | ||
pageforge deploy-github || echo "Deploy failed as expected in test environment" |