Github actions -- update node version and playwright config #9
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 Tests | |
on: | |
push: | |
branches: | |
- main | |
- 'release/*' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: Install dependencies | |
run: npm install | |
- name: Install Electron dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install build-essential clang libdbus-1-dev libgtk-3-dev \ | |
libnotify-dev libasound2-dev libcap-dev \ | |
libcups2-dev libxtst-dev \ | |
libxss1 libnss3-dev gcc-multilib g++-multilib curl \ | |
gperf bison python3-dbusmock openjdk-8-jre | |
- name: Build project | |
run: npm run build:linux | |
- name: List dist directory contents | |
run: ls -R dist | |
- name: Set executable permissions | |
run: | | |
chmod +x dist/linux-unpacked/dhis2-downloader | |
chmod +x dist/linux-unpacked/chrome-sandbox | |
chmod -R +x dist/linux-unpacked | |
- name: Run Playwright tests | |
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" npm run test:playwright | |
env: | |
ELECTRON_NO_ATTACH_CONSOLE: true | |
ELECTRON_DISABLE_SANDBOX: true | |
DEBUG: pw:api | |
TEST_DHIS2_URL: ${{ secrets.TEST_DHIS2_URL }} | |
TEST_USERNAME: ${{ secrets.TEST_USERNAME }} | |
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }} | |
- name: Upload Playwright test results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: playwright-test-results | |
path: test-results/ | |