Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Setup lint and testing suites (#203) #605

Setup lint and testing suites (#203)

Setup lint and testing suites (#203) #605

Workflow file for this run

name: ci
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build for production
run: bun run build --configuration=production
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Build-artifacts
path: dist/
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Lint
run: bun run lint
unit-tests:
if: ${{ github.event_name == 'pull_request' }}
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Unit tests
run: bun run test --no-watch --no-progress --browsers=ChromeHeadless
unit-tests-upload:
# This job uses a secret
# Pull requests are untrusted
if: ${{ github.event_name == 'push' }}
name: Unit tests and upload to Codecov
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Unit tests
run: bun run test --no-watch --no-progress --browsers=ChromeHeadless
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}