Update: #28
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: CI | |
on: | |
push: | |
branches: | |
- main | |
- 'release/*' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build_on_ubuntu: | |
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/ | |
- name: Upload error screenshots | |
uses: actions/upload-artifact@v2 | |
if: failure() | |
with: | |
name: error-screenshots | |
path: test-results/error-screenshot.png | |
build_on_mac: | |
runs-on: macOS-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: Build project | |
run: npm run build:mac | |
- name: Run Playwright tests | |
run: 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 }} | |
build_on_win: | |
runs-on: windows-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: Build project | |
run: npm run build:win | |
- name: Run Playwright tests | |
run: 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 }} |