64e9e7fcda
* tests: Frontend test Windows ZIP This PR introduces Frontend testing within Github actions! We're depending a lot on saucelabs recently and that's fine but sometimes we just want to quickly do a frontend simple test on a weird environment (IE windows build) so this PR solves that problem. Things to note. It still builds the windows .zip if the cypress tests fail. It does not add any heavy deps to Etherpad as cypress must be installed in CI. Cypress is responsible for running the Etherpad instance. It's up to us how much we use this or not, I know it introduces a bunch of technical debt but I tried to keep that a minimum by compartmentalizing things and documenting where required. * Update .github/workflows/windows-zip.yml Co-authored-by: Richard Hansen <rhansen@rhansen.org> * remove timeouts * Move folder structure up a level * Update windows-zip.yml * Update test.js Co-authored-by: Richard Hansen <rhansen@rhansen.org>
77 lines
2 KiB
YAML
77 lines
2 KiB
YAML
name: "Windows Zip"
|
|
|
|
# any branch is useful for testing before a PR is submitted
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
# run on pushes to any branch
|
|
# run on PRs from external forks
|
|
if: |
|
|
(github.event_name != 'pull_request')
|
|
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
|
name: Build
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- uses: msys2/setup-msys2@v2
|
|
with:
|
|
path-type: inherit
|
|
install: >-
|
|
zip
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 12
|
|
|
|
- name: Install all dependencies and symlink for ep_etherpad-lite
|
|
shell: msys2 {0}
|
|
run: src/bin/installDeps.sh
|
|
|
|
- name: Run the backend tests
|
|
shell: msys2 {0}
|
|
run: cd src && npm test
|
|
|
|
- name: Build the .zip
|
|
shell: msys2 {0}
|
|
run: src/bin/buildForWindows.sh
|
|
|
|
- name: Archive production artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: etherpad-lite-win.zip
|
|
path: etherpad-lite-win.zip
|
|
|
|
|
|
deploy:
|
|
# run on pushes to any branch
|
|
# run on PRs from external forks
|
|
if: |
|
|
(github.event_name != 'pull_request')
|
|
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
|
name: Deploy
|
|
needs: build
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Download zip
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: etherpad-lite-win.zip
|
|
|
|
- name: Extract Etherpad
|
|
run: 7z x etherpad-lite-win.zip -oetherpad
|
|
|
|
- name: Install Cypress
|
|
run: npm install cypress -g
|
|
|
|
- name: Run Etherpad
|
|
run: |
|
|
cd etherpad
|
|
node node_modules\ep_etherpad-lite\node\server.js &
|
|
curl --connect-timeout 10 --max-time 20 --retry 5 --retry-delay 10 --retry-max-time 60 --retry-connrefused http://127.0.0.1:9001/p/test
|
|
cd src\tests\frontend
|
|
cypress run --spec cypress\integration\test.js --config-file cypress\cypress.json
|