CI: New workflows for tests #13
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: 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-latest | |
arch: x64 | |
- os: macos-latest | |
arch: arm64 | |
- os: windows-latest | |
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 (macOS, Linux) | |
if: ${{ runner.os != 'Windows' }} | |
run: echo "npm_cache_dir=$(npm config get cache)" >> ${GITHUB_ENV} | |
- name: Get npm cache directory (Windows) | |
if: ${{ runner.os == 'Windows' }} | |
shell: pwsh | |
run: echo "npm_cache_dir=$(npm config get cache)" >> ${env: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 Python setuptools (macOS) | |
if: ${{ runner.os == 'macOS' }} | |
run: brew install python-setuptools | |
- name: Install minikube (Linux) | |
if: ${{ runner.os == 'Linux' }} | |
uses: medyagh/setup-minikube@master | |
with: | |
kubernetes-version: v1.30.1 | |
- name: Install 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' }} | |
run: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' npm run test:integration | |
- name: Run integration tests (macOS, Windows) | |
if: ${{ runner.os != 'Linux' }} | |
run: npm run test:integration | |
- name: Clean after tests | |
run: npm run clean | |
- name: Check untracked files (macOS, Linux) | |
if: ${{ runner.os != 'Windows' }} | |
run: for f in $(git ls-files --others --exclude-standard); do git diff --no-index --stat --exit-code /dev/null $f; done | |
- name: Check untracked files (Windows) | |
if: ${{ runner.os == 'Windows' }} | |
shell: pwsh | |
run: git ls-files --others --exclude-standard | ForEach-Object { git diff --no-index --stat --exit-code NUL $_ } |