mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-14 13:55:20 +01:00
[GitHub] Update and optimize workflows (#6825)
This commit is contained in:
parent
3302d23137
commit
516bc5dce1
1
.github/REUSE.toml
vendored
1
.github/REUSE.toml
vendored
@ -9,6 +9,7 @@ version = 1
|
||||
[[annotations]]
|
||||
path = [
|
||||
"workflows/**/*.yml",
|
||||
"actions/**/*.yml",
|
||||
"ISSUE_TEMPLATE/**/*.yml",
|
||||
"FUNDING.yml",
|
||||
"CODEOWNERS",
|
||||
|
||||
17
.github/actions/setup-deps/action.yml
vendored
Normal file
17
.github/actions/setup-deps/action.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
name: "Setup pnpm and Node.js"
|
||||
description: "Setup pnpm and Node.js environment for workflows. Requires the repo to be cloned to at least have .nvmrc and package.json"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
shell: bash
|
||||
2
.github/workflows/create-release.yml
vendored
2
.github/workflows/create-release.yml
vendored
@ -45,7 +45,7 @@ jobs:
|
||||
private-key: ${{ secrets.PAGEFAULT_APP_PRIVATE_KEY }}
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: "recursive"
|
||||
# Always base off of beta branch, regardless of the branch the workflow was triggered from.
|
||||
|
||||
12
.github/workflows/deploy-beta.yml
vendored
12
.github/workflows/deploy-beta.yml
vendored
@ -15,20 +15,12 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: "recursive"
|
||||
ref: ${{ vars.BETA_DEPLOY_BRANCH || 'beta'}}
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
- uses: ./.github/actions/setup-deps
|
||||
|
||||
- name: Build
|
||||
run: pnpm build:beta
|
||||
|
||||
12
.github/workflows/deploy.yml
vendored
12
.github/workflows/deploy.yml
vendored
@ -14,19 +14,11 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
- uses: ./.github/actions/setup-deps
|
||||
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
|
||||
8
.github/workflows/github-pages.yml
vendored
8
.github/workflows/github-pages.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository for Typedoc
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
path: pokerogue_docs
|
||||
|
||||
@ -42,7 +42,7 @@ jobs:
|
||||
rm -rf assets
|
||||
|
||||
- name: Checkout asset submodule
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: 'pagefaultgames/pokerogue-assets'
|
||||
ref: ${{ steps.asset-submodule-ref.asset_ref }}
|
||||
@ -59,13 +59,13 @@ jobs:
|
||||
version: 10
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: "pokerogue_docs/.nvmrc"
|
||||
|
||||
- name: Checkout repository for Github Pages
|
||||
if: github.event_name == 'push'
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
path: pokerogue_gh
|
||||
ref: gh-pages
|
||||
|
||||
20
.github/workflows/linting.yml
vendored
20
.github/workflows/linting.yml
vendored
@ -25,21 +25,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: "recursive"
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install Node modules
|
||||
run: pnpm i
|
||||
- uses: ./.github/actions/setup-deps
|
||||
|
||||
# Lint files with Biome-Lint - https://biomejs.dev/linter/
|
||||
- name: Lint with Biome
|
||||
@ -64,13 +55,6 @@ jobs:
|
||||
id: typecheck-scripts
|
||||
if: ${{ !cancelled() }}
|
||||
|
||||
# NOTE: These steps *must* be ran last for the moment due to deleting files in `assets/`.
|
||||
# Some asset files do not yet have full licensing information, and thus must be removed
|
||||
# before checking for REUSE compliance
|
||||
- name: Prepare for REUSE compliance
|
||||
run: rm -rf assets/* LICENSES/LicenseRef-*
|
||||
if: ${{ !cancelled() }}
|
||||
|
||||
- name: Check for REUSE compliance
|
||||
id: reuse-lint
|
||||
uses: fsfe/reuse-action@v5
|
||||
|
||||
14
.github/workflows/test-shard-template.yml
vendored
14
.github/workflows/test-shard-template.yml
vendored
@ -18,21 +18,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v4.2.2
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: "recursive"
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install Node.js dependencies
|
||||
run: pnpm i
|
||||
- uses: ./.github/actions/setup-deps
|
||||
|
||||
- name: Run tests
|
||||
run: >
|
||||
|
||||
24
.github/workflows/tests.yml
vendored
24
.github/workflows/tests.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
||||
all: ${{ steps.filter.outputs.all }}
|
||||
steps:
|
||||
- name: Checkout GitHub repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
sparse-checkout: |
|
||||
.github/test-filters.yml
|
||||
@ -60,28 +60,22 @@ jobs:
|
||||
if: ${{ needs.run-tests.result != 'skipped' && needs.run-tests.result != 'cancelled' }}
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v4.2.2
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: "recursive"
|
||||
sparse-checkout: |
|
||||
.github/actions/setup-deps/action.yml
|
||||
test/setup
|
||||
test/test-utils/reporters/custom-default-reporter.ts
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install Packages
|
||||
run: pnpm i
|
||||
- uses: ./.github/actions/setup-deps
|
||||
|
||||
- name: Download blob artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
pattern: shard-?-blob
|
||||
path: test-results
|
||||
merge-multiple: true
|
||||
|
||||
- name: Merge blobs
|
||||
run: pnpm test:silent --merge-reports=test-results
|
||||
run: pnpm test:merge-reports
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
"test:cov": "vitest run --coverage --no-isolate",
|
||||
"test:watch": "vitest watch --coverage --no-isolate",
|
||||
"test:silent": "vitest run --silent='passed-only' --no-isolate",
|
||||
"test:merge-reports": "MERGE_REPORTS=1 vitest run --merge-reports=test-results --silent=passed-only --configLoader runner",
|
||||
"test:create": "node scripts/create-test/create-test.js",
|
||||
"eggMoves:parse": "node scripts/parse-egg-moves/main.js",
|
||||
"scrape-trainers": "node scripts/scrape-trainer-names/main.js",
|
||||
|
||||
@ -6,11 +6,15 @@
|
||||
|
||||
import { defineConfig, loadEnv, type Rollup, type UserConfig } from "vite";
|
||||
import tsconfigPaths from "vite-tsconfig-paths";
|
||||
import { LocaleNamespace } from "./src/plugins/vite/namespaces-i18n-plugin";
|
||||
import { minifyJsonPlugin } from "./src/plugins/vite/vite-minify-json-plugin";
|
||||
|
||||
export const defaultConfig: UserConfig = {
|
||||
plugins: [tsconfigPaths(), minifyJsonPlugin(["images", "battle-anims"], true), LocaleNamespace()],
|
||||
plugins: process.env.MERGE_REPORTS
|
||||
? []
|
||||
: [
|
||||
tsconfigPaths(),
|
||||
require("./src/plugins/vite/vite-minify-json-plugin").minifyJsonPlugin(["images", "battle-anims"], true),
|
||||
require("./src/plugins/vite/namespaces-i18n-plugin").LocaleNamespace(),
|
||||
],
|
||||
clearScreen: false,
|
||||
appType: "mpa",
|
||||
build: {
|
||||
@ -41,7 +45,7 @@ export default defineConfig(({ mode, command }) => {
|
||||
keepNames: true,
|
||||
},
|
||||
server: {
|
||||
port: !Number.isNaN(envPort) ? envPort : 8000,
|
||||
port: Number.isNaN(envPort) ? 8000 : envPort,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user