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

chore: add beta branch #282

chore: add beta branch

chore: add beta branch #282

Workflow file for this run

name: Test and release
# Run the workflow when a Pull Request is opened or when changes are pushed to master
on:
pull_request:
push:
branches: [main, beta]
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
test:
runs-on: ubuntu-latest
strategy:
matrix:
# Run the steps below with the following versions of Node.js
node-version: [20.x]
env:
DATABASE_URL: "file:./dev.db"
steps:
# Fetch the latest commit
- name: Checkout
uses: actions/checkout@v4
# Setup Bun
- name: Setup Bun
uses: oven-sh/setup-bun@v1
# Install package dependencies
- name: Install
run: bun i
# Run migrations
- name: Migrate
run: bun migrate
# Run tests
- name: Test
run: bun test
release:
# Only release on push to main
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta')
runs-on: ubuntu-latest
# Waits for test jobs for each Node.js version to complete
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install
run: bun i
- name: Release
run: bunx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}