Skip to content

Cleaning up

Cleaning up #794

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
workflow_dispatch:
jobs:
ci:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows (Intel)
os: windows-2022
- name: Windows (ARM)
os: windows-11-arm
- name: Linux (Intel)
os: ubuntu-22.04
- name: Linux (ARM)
os: ubuntu-22.04-arm
- name: macOS (Intel)
os: macos-15-intel
- name: macOS (ARM)
os: macos-15
- name: Code formatting
os: ubuntu-22.04
- name: Linting
os: ubuntu-22.04
steps:
- name: Set the timezone to New Zealand
uses: szenius/[email protected]
with:
timezoneWindows: 'New Zealand Standard Time'
timezoneLinux: 'Pacific/Auckland'
timezoneMacos: 'Pacific/Auckland'
- name: Check out OpenCOR
uses: actions/checkout@v4
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install bun
if: ${{ matrix.name != 'Windows (ARM)' }}
uses: oven-sh/setup-bun@v2
- name: Install bun (Windows ARM only)
if: ${{ matrix.name == 'Windows (ARM)' }}
run: |
curl -L https://github.com/oven-sh/bun/releases/latest/download/bun-windows-x64-baseline.zip -o bun.zip
unzip -j bun.zip -d $env:USERPROFILE\.bun
del bun.zip
echo "$env:USERPROFILE\.bun" >> $env:GITHUB_PATH
- name: OpenCOR dependencies
if: ${{ matrix.name != 'Windows (ARM)' }}
run: bun install
- name: OpenCOR dependencies (Windows ARM only)
if: ${{ matrix.name == 'Windows (ARM)' }}
run: bun install --cpu=arm64
- name: Build libOpenCOR
if: ${{ matrix.name != 'Code formatting' && matrix.name != 'Linting' }}
run: bun libopencor
- name: Build OpenCOR
if: ${{ matrix.name != 'Code formatting' && matrix.name != 'Linting' }}
run: bun run build
- name: Build OpenCOR's Web app
if: ${{ matrix.name != 'Code formatting' && matrix.name != 'Linting' }}
env:
VITE_FIREBASE_API_KEY: ${{ secrets.VITE_FIREBASE_API_KEY }}
VITE_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.VITE_FIREBASE_MESSAGING_SENDER_ID }}
VITE_FIREBASE_APP_ID: ${{ secrets.VITE_FIREBASE_APP_ID }}
VITE_FIREBASE_MEASUREMENT_ID: ${{ secrets.VITE_FIREBASE_MEASUREMENT_ID }}
run: bun build:web
- name: Build OpenCOR's npm library
if: ${{ matrix.name != 'Code formatting' && matrix.name != 'Linting' }}
run: |
cd src/renderer
bun install
bun build:lib
- name: Code formatting
if: ${{ matrix.name == 'Code formatting' }}
run: bun format:check
- name: Linting
if: ${{ matrix.name == 'Linting' }}
run: bun lint
- name: Clean OpenCOR
run: bun clean