Use Ubuntu 20.04 for better compatibility with older Linux (#37) #78
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: Integration tests | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: {} | |
permissions: | |
contents: read | |
jobs: | |
test-integration: | |
name: integration tests on ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
arch: x64 | |
- os: macos-14 | |
arch: arm64 | |
- os: windows-2022 | |
arch: x64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
- name: Get npm cache directory | |
shell: bash | |
run: echo "npm_cache_dir=$(npm config get cache)" >> ${GITHUB_ENV} | |
- name: Use cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.npm_cache_dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies (macOS) | |
if: runner.os == 'macOS' | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 20 | |
max_attempts: 3 | |
retry_on: error | |
command: brew install python-setuptools | |
- name: Install minikube (Linux) | |
if: runner.os == 'Linux' | |
uses: medyagh/setup-minikube@master | |
with: | |
kubernetes-version: v1.31.0 | |
- name: Install NPM dependencies | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 20 | |
max_attempts: 3 | |
retry_on: error | |
command: npm ci | |
- name: Build | |
run: npm run build | |
- name: Build Electron app | |
run: npm run build:app -- -- -- dir --${{ matrix.arch }} | |
- name: Run integration tests (Linux) | |
if: runner.os == 'Linux' | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 15 | |
max_attempts: 3 | |
retry_on: timeout | |
command: | | |
sudo chown root:root freelens/dist/linux-unpacked/chrome-sandbox | |
sudo chmod 4755 freelens/dist/linux-unpacked/chrome-sandbox | |
xvfb-run -a npm run test:integration | |
env: | |
DEBUG: pw:browser | |
- name: Run integration tests (macOS, Windows) | |
if: runner.os != 'Linux' | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 15 | |
max_attempts: 3 | |
retry_on: timeout | |
command: npm run test:integration | |
env: | |
DEBUG: pw:browser | |
- name: Clean after tests | |
run: npm run clean | |
- name: Check untracked files | |
shell: bash | |
run: for f in $(git ls-files --others --exclude-standard); do git diff --no-index --stat --exit-code /dev/null $f; done |