-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
202 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
name: main - Code Validation | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
|
||
############################################################################## | ||
# CODE QUALITY | ||
############################################################################## | ||
|
||
check_file_headers: | ||
name: Check file headers | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Deno | ||
uses: denoland/setup-deno@v1 | ||
|
||
- name: Check file headers | ||
run: | | ||
deno task check:file-headers | ||
lint_code: | ||
name: Check for lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Deno | ||
uses: denoland/setup-deno@v1 | ||
|
||
- name: Run Deno linter | ||
run: deno lint | ||
|
||
code_formatting: | ||
name: Check code formatting | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Deno | ||
uses: denoland/setup-deno@v1 | ||
|
||
- name: Run Deno formatter check | ||
run: deno fmt --check | ||
|
||
############################################################################## | ||
# TESTS - COMPATIBILITY | ||
############################################################################## | ||
|
||
tests_compat_bun: | ||
name: Compat - Bun | ||
needs: [check_file_headers, lint_code, code_formatting] | ||
|
||
strategy: | ||
matrix: | ||
# Add Windows when https://github.com/oven-sh/bun/issues/43 is complete | ||
os: [ubuntu-latest, macos-latest] | ||
node-version: [18.x, 20.x] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Deno (for `deno` command) | ||
uses: denoland/setup-deno@v1 | ||
|
||
- name: Install Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install Node dependencies | ||
run: | | ||
yarn install | ||
- name: Install Bun | ||
run: | | ||
curl -fsSL https://bun.sh/install | bash | ||
- name: Run Tests | ||
run: | | ||
deno task build:libs && ~/.bun/bin/bun test tests/compat/bun | ||
# tests_compat_cloudflare: | ||
# name: Compat - Cloudflare | ||
# needs: [check_file_headers, lint_code, code_formatting] | ||
|
||
# strategy: | ||
# matrix: | ||
# os: [ubuntu-latest, windows-latest, macos-latest] | ||
# node-version: [18.x, 20.x] | ||
# runs-on: ${{ matrix.os }} | ||
|
||
# steps: | ||
# - uses: actions/checkout@v4 | ||
|
||
# - name: Install Deno (for `deno` command) | ||
# uses: denoland/setup-deno@v1 | ||
|
||
# - name: Install Node ${{ matrix.node-version }} | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version: ${{ matrix.node-version }} | ||
|
||
# - name: Install Node dependencies | ||
# run: | | ||
# yarn install | ||
|
||
# - name: Run Tests | ||
# run: | | ||
# deno task build:libs && deno task test:compat:cloudflare | ||
|
||
tests_compat_deno: | ||
name: Compat - Deno | ||
needs: [check_file_headers, lint_code, code_formatting] | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Deno | ||
uses: denoland/setup-deno@v1 | ||
|
||
- name: Run Tests | ||
run: | | ||
deno task test:compat:deno | ||
- name: Run Tests (Concurrency) | ||
run: | | ||
deno task test:compat:deno:concurrency | ||
- name: Run Tests (Middleware) | ||
run: | | ||
deno task test:middleware:deno | ||
tests_compat_node: | ||
name: Compat - Node | ||
needs: [check_file_headers, lint_code, code_formatting] | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
node-version: [18.x, 20.x] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Deno (for `deno` command) | ||
uses: denoland/setup-deno@v1 | ||
|
||
- name: Install Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Instal Node dependencies | ||
run: | | ||
yarn install | ||
- name: Run Tests | ||
run: | | ||
deno task build:libs && deno task test:compat:node | ||
############################################################################## | ||
# TESTS - UNIT | ||
############################################################################## | ||
|
||
tests_unit: | ||
name: Compat - Node | ||
needs: [check_file_headers, lint_code, code_formatting] | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
node-version: [18.x, 20.x] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Deno (for `deno` command) | ||
uses: denoland/setup-deno@v1 | ||
|
||
- name: Run Tests | ||
run: | | ||
deno task test:unit |