Skip to content

Implements GH-220

Implements GH-220 #492

Workflow file for this run

name: Tests
on:
push:
branches: [1.x, 2.x, 2.*.x, 3.x]
paths:
- "**.py"
- skins/**
- bin/**
- test/**
- package.json
- yarn.lock
- playwright.config.ts
pull_request:
branches: [1.x, 2.x, 2.*.x, 3.x]
paths:
- "**.py"
- skins/**
- bin/**
- test/**
- package.json
- yarn.lock
- playwright.config.ts
jobs:
shunit2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "14"
cache: "yarn"
- name: Set timezone
uses: szenius/[email protected]
with:
timezoneLinux: "Europe/Berlin"
- name: Install yarn and dependecies
run: yarn install
- name: Set custom run basePath
env:
CUSTOM_BASE_PATH: "${{ github.workspace }}/test/e2e-tests/artifacts-custom-weewx-html/public_html/"
run: |
echo "$CUSTOM_BASE_PATH"
sed -i -z "s|base_path = \/home\/dba\/dev\/weewx-wdc\/test\/e2e-tests\/artifacts-custom-weewx-html\/public_html/|base_path = \"${CUSTOM_BASE_PATH}\"|g" test/test_install_report/src/skin-custom.conf
sed -i -z "s|cloudbase = \/home\/dba\/dev\/weewx-wdc\/test\/e2e-tests\/artifacts-custom-weewx-html\/public_html\/dwd\/icons\/8.png|cloudbase = \"${CUSTOM_BASE_PATH}dwd\/icons\/8.png\"|g" test/test_install_report/src/skin-custom.conf
echo $(cat test/test_install_report/src/skin-custom.conf)
- name: Set OWM API key
env:
OWM_KEY: ${{ secrets.OWM }}
run: sed -i -z -e "s|SECRET_OWM|${OWM_KEY}|g" test/test_install_report/src/start-forecast.sh
- name: Run shunit2 tests
run: ./test/run_tests.sh
- name: Upload log artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: test_install_report_artifacts
path: test/test_install_report/artifacts/
- name: Upload alternative html
uses: actions/upload-artifact@v3
with:
name: artifacts-alternative-weewx-html
path: test/test_install_report/artifacts-alternative-weewx-html/
- name: Upload classic html
uses: actions/upload-artifact@v3
with:
name: artifacts-classic-weewx-html
path: test/test_install_report/artifacts-classic-weewx-html/
- name: Upload forecast html
uses: actions/upload-artifact@v3
with:
name: artifacts-forecast-weewx-html
path: test/test_install_report/artifacts-forecast-weewx-html/
- name: Upload custom html
uses: actions/upload-artifact@v3
with:
name: artifacts-custom-weewx-html
path: test/test_install_report/artifacts-custom-weewx-html/
- name: Upload weewx-DWD html
uses: actions/upload-artifact@v3
with:
name: artifacts-dwd-weewx-html
path: test/test_install_report/artifacts-dwd-weewx-html/
- name: Upload custom binding html
uses: actions/upload-artifact@v3
with:
name: artifacts-custom-binding-weewx-html
path: test/test_install_report/artifacts-custom-binding-weewx-html/
- name: Upload mqtt html
uses: actions/upload-artifact@v3
with:
name: artifacts-mqtt-weewx-html
path: test/test_install_report/artifacts-mqtt-weewx-html/
- name: Upload sensor status html
uses: actions/upload-artifact@v3
with:
name: artifacts-sensor-status-weewx-html
path: test/test_install_report/artifacts-sensor-status-weewx-html/
- name: Upload cmon html
uses: actions/upload-artifact@v3
with:
name: artifacts-cmon-weewx-html
path: test/test_install_report/artifacts-cmon-weewx-html/
playwright:
needs: shunit2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 🔨 Setup node
uses: actions/setup-node@v3
with:
node-version: "14"
cache: "yarn"
- name: Set timezone
uses: szenius/[email protected]
with:
timezoneLinux: "Europe/Berlin"
- name: 🔨 install yarn and dependecies
run: yarn install
- name: install playwright deps
run: yarn playwright install --with-deps
- name: Download alternative html
uses: actions/download-artifact@v3
with:
name: artifacts-alternative-weewx-html
path: test/e2e-tests/artifacts-alternative-weewx-html
- name: Download classic html
uses: actions/download-artifact@v3
with:
name: artifacts-classic-weewx-html
path: test/e2e-tests/artifacts-classic-weewx-html
- name: Download forecast html
uses: actions/download-artifact@v3
with:
name: artifacts-forecast-weewx-html
path: test/e2e-tests/artifacts-forecast-weewx-html
- name: Download custom html
uses: actions/download-artifact@v3
with:
name: artifacts-custom-weewx-html
path: test/e2e-tests/artifacts-custom-weewx-html
- name: Download weewx-dwd html
uses: actions/download-artifact@v3
with:
name: artifacts-dwd-weewx-html
path: test/e2e-tests/artifacts-dwd-weewx-html
- name: Download custom binding html
uses: actions/download-artifact@v3
with:
name: artifacts-custom-binding-weewx-html
path: test/e2e-tests/artifacts-custom-binding-weewx-html
- name: Download mqtt html
uses: actions/download-artifact@v3
with:
name: artifacts-mqtt-weewx-html
path: test/e2e-tests/artifacts-mqtt-weewx-html
- name: Download sensor status html
uses: actions/download-artifact@v3
with:
name: artifacts-sensor-status-weewx-html
path: test/e2e-tests/artifacts-sensor-status-weewx-html
- name: Download cmon html
uses: actions/download-artifact@v3
with:
name: artifacts-cmon-weewx-html
path: test/e2e-tests/artifacts-cmon-weewx-html
- name: Run playwright tests
run: yarn run test:e2e
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-report
path: test/e2e-tests/playwright-report