From a1fada4e7f0be2d5aa661aee483a59ba93bacb40 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 9 Aug 2023 18:49:13 -0700 Subject: ci: :green_heart: install Xvfb to run headless electron on Linux --- .github/workflows/main.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to '.github') diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4f1e538c..8249b576 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -14,6 +14,8 @@ jobs: runs-on: ${{ matrix.os }} steps: + # Install Python requirements and build+upload binaries for each platform + - name: Check-out repository uses: actions/checkout@v3 @@ -55,6 +57,8 @@ jobs: - name: Checkout uses: actions/checkout@v2 + # Download corresponding binary artifact for the platform + - name: Create exe directory run: | mkdir extension/server/exe @@ -80,6 +84,8 @@ jobs: path: extension/server/exe/windows if: matrix.os == 'windows-latest' + # Setup Node.js and install dependencies + - name: Use Node.js 19.0.0 uses: actions/setup-node@v3 with: @@ -107,16 +113,26 @@ jobs: cd extension/react-app npm ci --legacy-peer-deps + # Run tests + - name: Package the extension run: | cd extension npm run package + - name: Install Xvfb for Linux + run: | + sudo apt-get install -y xvfb # Install Xvfb + Xvfb :99 & # Start Xvfb + export DISPLAY=:99 # Export the display number to the environment + if: matrix.os == 'ubuntu-20.04' + - name: Run extension tests run: | cd extension npm run test + # Package again and build+upload the .vsix - name: Remove exe directory and re-package run: | cd extension @@ -137,6 +153,8 @@ jobs: contents: write steps: + # Checkout and download .vsix artifact + - name: Checkout uses: actions/checkout@v2 @@ -146,6 +164,8 @@ jobs: name: vsix-artifact path: extension/build + # Publish the extension and commit/push the version change + - name: Publish run: | cd extension -- cgit v1.2.3-70-g09d2