Merge pull request #487 from Xpirix/update_hugo_version #562
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
name: 🧪 Playwright End To End (e2e) Tests Workflow | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main, develop ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
e2e-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🛒 Checkout | |
uses: actions/checkout@v2 | |
- name: 🛠️ Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: 'latest' # We will be alerted if our code has deprecated functions | |
extended: true | |
- name: 🧱 Hugo build | |
run: hugo --gc --config ./config.toml -b http://127.0.0.1:1313 | |
- name: 🕸️ Run server | |
run: | | |
cd public && python -m http.server 1313 & | |
- name: Test hugo endpoint | |
run: | | |
curl -v http://127.0.0.1:1313 | |
if [ $? -ne 0 ]; then | |
echo "Curl command failed" | |
exit 1 | |
fi | |
- name: 👨👩👧 Install playwright dependencies | |
working-directory: playwright/ci-test | |
run: | | |
npm install | |
npm ci | |
npx playwright install --with-deps | |
- name: ⚡️ Run Playwright tests | |
working-directory: playwright/ci-test | |
run: npx playwright test | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright/ci-test/playwright-report/ | |
retention-days: 30 |