tests on linux #6373
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: Node CI | |
on: | |
push: | |
branches: | |
- master | |
- canary | |
pull_request: | |
defaults: | |
run: | |
shell: bash | |
env: | |
NODE_VERSION: 18.x | |
jobs: | |
build: | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache/restore@v3 | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock', 'app/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install | |
run: yarn install | |
env: | |
npm_config_node_gyp: ${{ github.workspace }}${{ runner.os == 'Windows' && '\node_modules\node-gyp\bin\node-gyp.js' || '/node_modules/node-gyp/bin/node-gyp.js' }} | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
- name: Install libarchive-tools | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt update | |
sudo apt install libarchive-tools | |
- name: Lint and Run Unit Tests | |
run: yarn run test | |
- name: Getting Build Icon | |
if: github.ref == 'refs/heads/canary' || github.base_ref == 'canary' | |
run: | | |
cp build/canary.ico build/icon.ico | |
cp build/canary.icns build/icon.icns | |
- name: Build | |
run: | | |
if [ -z "$CSC_LINK" ] ; then unset CSC_LINK ; fi | |
if [ -z "$CSC_KEY_PASSWORD" ] ; then unset CSC_KEY_PASSWORD ; fi | |
if [ -z "$WIN_CSC_LINK" ] ; then unset WIN_CSC_LINK ; fi | |
if [ -z "$WIN_CSC_KEY_PASSWORD" ] ; then unset WIN_CSC_KEY_PASSWORD ; fi | |
if [ -z "$APPLE_ID" ] ; then unset APPLE_ID ; fi | |
if [ -z "$APPLE_APP_SPECIFIC_PASSWORD" ] ; then unset APPLE_APP_SPECIFIC_PASSWORD ; fi | |
yarn run dist | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CSC_LINK: ${{ secrets.MAC_CERT_P12_BASE64 }} | |
CSC_KEY_PASSWORD: ${{ secrets.MAC_CERT_P12_PASSWORD }} | |
WIN_CSC_LINK: ${{ secrets.WIN_CERT_P12_BASE64 }} | |
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CERT_P12_PASSWORD }} | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | |
- name: Archive Build Artifacts | |
uses: LabhanshAgrawal/upload-artifact@v3 | |
with: | |
path: | | |
dist/*.dmg | |
dist/*.snap | |
dist/*.AppImage | |
dist/*.deb | |
dist/*.rpm | |
dist/*.pacman | |
dist/*.exe | |
- name: Run E2E Tests | |
if: runner.os != 'Linux' | |
run: yarn run test:e2e | |
- name: Run E2E Tests on Linux | |
if: runner.os == 'Linux' | |
# uses: GabrielBB/[email protected] | |
# with: | |
# working-directory: . | |
# run: yarn run test:e2e | |
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn run test:e2e | |
- name: Archive E2E test screenshot | |
uses: actions/upload-artifact@v3 | |
with: | |
name: e2e | |
path: dist/tmp/*.png | |
- name: Save the pr number in an artifact | |
if: github.event_name == 'pull_request' | |
env: | |
PR_NUM: ${{ github.event.number }} | |
run: echo $PR_NUM > pr_num.txt | |
- name: Upload the pr num | |
uses: actions/upload-artifact@v3 | |
if: github.event_name == 'pull_request' | |
with: | |
name: pr_num | |
path: ./pr_num.txt | |
- uses: actions/cache/save@v3 | |
if: github.event_name == 'push' | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock', 'app/yarn.lock') }} |