[RFR] Nightly CI for Vscode tests #27
Workflow file for this run
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: Run Playwright tests nightly on main branch | |
on: | |
# schedule: | |
# - cron: "5 3 * * *" | |
# workflow_dispatch: | |
[push, pull_request] | |
jobs: | |
main-nightly: | |
runs-on: ubuntu-latest | |
services: | |
xvfb: | |
image: dorowu/ubuntu-desktop-lxde-vnc | |
ports: | |
- 5900:5900 | |
options: >- | |
--privileged | |
--shm-size 2g | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
- name: Install vscode dependencies | |
run: sudo apt-get update && sudo apt-get install -y wget | |
- name: Download and Install VSCode | |
run: | | |
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg | |
sudo install -o root -g root -m 644 microsoft.gpg /usr/share/keyrings/ | |
echo "deb [signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" | sudo tee /etc/apt/sources.list.d/vscode.list | |
sudo apt-get update | |
sudo apt-get install -y code | |
- name: Set DISPLAY environment variable | |
run: | | |
Xvfb :99 -screen 0 1920x1080x24 & | |
echo "DISPLAY=:99" >> $GITHUB_ENV | |
- name: Verify Installation | |
run: code --version | |
- name: Verbose code | |
run: code --verbose | |
- name: Verify VSCode Path | |
run: | | |
if [ -f /usr/share/code/code ]; then | |
echo "VSCode is installed at /usr/share/code/code" | |
else | |
echo "VSCode is NOT found at /usr/share/code/code" | |
echo "Listing /usr/share/code:" | |
ls /usr/share/code | |
fi | |
- name: Ensure no VSCode instances are running | |
run: | | |
pkill -f code || true # Kills all VSCode processes if they are running | |
- name: Install playwright dependencies | |
run: npm install | |
- name: More dependencies | |
run: npm ci | |
- name: Copy .env.example to .env | |
run: cp .env.example .env | |
- name: Run Playwright tests | |
run: npx playwright test | |
- name: Upload screenshots | |
uses: actions/upload-artifact@v3 | |
with: | |
name: vscode-screenshots | |
path: | | |
vscode-initialized-screenshot.png | |
vscode-window-title-check.png | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |