feat: implement #14
Workflow file for this run
This file contains hidden or 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: Build & Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| include: | |
| # Test xclip on Ubuntu with Node 22 | |
| - node-version: 22.x | |
| os: ubuntu-latest | |
| clipboard-tool: xclip | |
| install-cmd: sudo apt-get update && sudo apt-get install -y xclip xvfb | |
| test-cmd: xvfb-run -a pnpm test | |
| # Test xsel on Ubuntu with Node 22 | |
| - node-version: 22.x | |
| os: ubuntu-latest | |
| clipboard-tool: xsel | |
| install-cmd: sudo apt-get update && sudo apt-get install -y xsel xvfb | |
| test-cmd: xvfb-run -a pnpm test | |
| # Test xclip on Ubuntu with Node 24 | |
| - node-version: 24.x | |
| os: ubuntu-latest | |
| clipboard-tool: xclip | |
| install-cmd: sudo apt-get update && sudo apt-get install -y xclip xvfb | |
| test-cmd: xvfb-run -a pnpm test | |
| # Test xsel on Ubuntu with Node 24 | |
| - node-version: 24.x | |
| os: ubuntu-latest | |
| clipboard-tool: xsel | |
| install-cmd: sudo apt-get update && sudo apt-get install -y xsel xvfb | |
| test-cmd: xvfb-run -a pnpm test | |
| # We do not test wl-copy/wl-paste as setting up wayland in CI is tricky | |
| # We only test Node 24 on macOS and Windows to reduce CI usage | |
| - node-version: 24.x | |
| os: macos-14 | |
| - node-version: 24.x | |
| os: windows-2025 | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup PNPM | |
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | |
| - name: Use Node v${{ matrix.node-version }} | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: pnpm | |
| - name: Install Clipboard Tool | |
| if: matrix.clipboard-tool | |
| run: ${{ matrix.install-cmd }} | |
| - name: Install Dependencies | |
| run: pnpm install | |
| - name: Build | |
| run: pnpm build | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Test | |
| run: ${{ matrix.test-cmd || 'pnpm test' }} |