ci: add cache, add prettier, parallelize jobs (#85)

This commit is contained in:
Bas van den Wollenberg
2024-10-18 04:55:48 +02:00
committed by GitHub
parent 530ad2eb64
commit 9d7c6ca3d7
5 changed files with 74 additions and 34 deletions

14
.github/actions/setup/action.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
name: "Setup"
description: "Setup and install dependencies"
runs:
using: "composite"
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- shell: bash
run: npm ci

51
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: CI
on:
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
typecheck:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Run TypeScript compiler
run: npm run typecheck
lint:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Run Eslint
run: npm run lint:check
format:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Run Prettier
run: npm run format:check

View File

@@ -1,24 +0,0 @@
name: Static Analysis
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
Typing-and-Linting:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: npm install
- name: Run TypeScript compiler
run: npm run typecheck
- name: Run Eslint check
run: npm run lint:check

View File

@@ -2,7 +2,7 @@ import { notarize } from "@electron/notarize";
export default async (context) => {
if (process.platform !== "darwin") return;
console.log("aftersign hook triggered, start to notarize app.");
if (!process.env.CI) {

View File

@@ -12,17 +12,16 @@ async function createWindow() {
const [width, height] = getBounds();
function getIcon(): string {
if (process.platform === 'win32') {
return join(__dirname, '../../build/icon.ico');
if (process.platform === "win32") {
return join(__dirname, "../../build/icon.ico");
}
if (process.platform === 'darwin') {
return join(__dirname, '../../build/icon.icns');
}
return join(__dirname, '../../build/icon.png');
}
if (process.platform === "darwin") {
return join(__dirname, "../../build/icon.icns");
}
return join(__dirname, "../../build/icon.png");
}
const window = new BrowserWindow({
title: "osu!radio",