Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test windows 2019 #3

Draft
wants to merge 2 commits into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 'Build'
description: 'Runs the main build step'
inputs:
node-version:
description: 'Version of node to use'
required: true
os:
description: 'Host OS'
required: true
runs:
using: 'composite'
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4

- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'pnpm'

# Cargo already skips downloading dependencies if they already exist
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ inputs.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Cache turbo build
uses: actions/cache@v4
with:
path: .turbo
key: ${{ inputs.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ inputs.os }}-turbo-

# Cache the `oxide` Rust build
- name: Cache oxide build
uses: actions/cache@v4
with:
path: |
./target/
./crates/node/*.node
./crates/node/index.js
./crates/node/index.d.ts
key: ${{ inputs.os }}-oxide-${{ hashFiles('./crates/**/*') }}

- name: Install dependencies
shell: bash
run: pnpm install

- name: Build
shell: bash
run: pnpm run build
99 changes: 62 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,66 +9,91 @@ permissions:
contents: read

jobs:
lint:
strategy:
fail-fast: false
matrix:
node-version: [20]
# Only lint on linux to avoid \r\n line ending errors
runner: [ubuntu-latest]
runs-on: ${{ matrix.runner }}

steps:
- uses: actions/checkout@v4

- name: Build
uses: ./.github/actions/build
with:
os: ${{ runner.os }}
node-version: ${{ matrix.node-version }}

- name: Lint
run: pnpm run lint
if: matrix.runner == 'ubuntu-latest'

tests:
strategy:
fail-fast: false
matrix:
node-version: [20]
runner: [ubuntu-latest, windows-latest, macos-14]
runner: [ubuntu-latest, windows-2019, macos-14]

runs-on: ${{ matrix.runner }}
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Build
uses: ./.github/actions/build
with:
os: ${{ runner.os }}
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

# Cargo already skips downloading dependencies if they already exist
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

# Cache the `oxide` Rust build
- name: Cache oxide build
uses: actions/cache@v4
with:
path: |
./target/
./crates/node/*.node
./crates/node/index.js
./crates/node/index.d.ts
key: ${{ runner.os }}-oxide-${{ hashFiles('./crates/**/*') }}
- name: Test
run: pnpm run test

- name: Install dependencies
run: pnpm install
integration-tests:
strategy:
fail-fast: false
matrix:
node-version: [20]
runner: [ubuntu-latest, windows-2019, macos-14]

- name: Build
run: pnpm run build
runs-on: ${{ matrix.runner }}
timeout-minutes: 30

- name: Lint
run: pnpm run lint
# Only lint on linux to avoid \r\n line ending errors
if: matrix.runner == 'ubuntu-latest'
steps:
- uses: actions/checkout@v4

- name: Test
run: pnpm run test
- name: Build
uses: ./.github/actions/build
with:
os: ${{ runner.os }}
node-version: ${{ matrix.node-version }}

- name: Integration Tests
run: pnpm run test:integrations

e2e-tests:
strategy:
fail-fast: false
matrix:
node-version: [20]
runner: [ubuntu-latest, windows-2019, macos-14]

runs-on: ${{ matrix.runner }}
timeout-minutes: 30

steps:
- uses: actions/checkout@v4

- name: Build
uses: ./.github/actions/build
with:
os: ${{ runner.os }}
node-version: ${{ matrix.node-version }}

- name: Install Playwright Browsers
run: npx playwright install --with-deps

Expand Down
Loading