mirror of
https://github.com/SrIzan10/osu-radio.git
synced 2026-05-01 10:55:12 +00:00
ci: add cache, add prettier, parallelize jobs (#85)
This commit is contained in:
committed by
GitHub
parent
530ad2eb64
commit
9d7c6ca3d7
14
.github/actions/setup/action.yml
vendored
Normal file
14
.github/actions/setup/action.yml
vendored
Normal 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
51
.github/workflows/ci.yml
vendored
Normal 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
|
||||
24
.github/workflows/typescript.yml
vendored
24
.github/workflows/typescript.yml
vendored
@@ -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
|
||||
@@ -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) {
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user