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]]
|
[[annotations]]
|
||||||
path = [
|
path = [
|
||||||
"workflows/**/*.yml",
|
"workflows/**/*.yml",
|
||||||
|
"actions/**/*.yml",
|
||||||
"ISSUE_TEMPLATE/**/*.yml",
|
"ISSUE_TEMPLATE/**/*.yml",
|
||||||
"FUNDING.yml",
|
"FUNDING.yml",
|
||||||
"CODEOWNERS",
|
"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 }}
|
private-key: ${{ secrets.PAGEFAULT_APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
# Always base off of beta branch, regardless of the branch the workflow was triggered from.
|
# 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
|
timeout-minutes: 10
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
ref: ${{ vars.BETA_DEPLOY_BRANCH || 'beta'}}
|
ref: ${{ vars.BETA_DEPLOY_BRANCH || 'beta'}}
|
||||||
|
|
||||||
- name: Install pnpm
|
- uses: ./.github/actions/setup-deps
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version-file: ".nvmrc"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm i
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build:beta
|
run: pnpm build:beta
|
||||||
|
|||||||
12
.github/workflows/deploy.yml
vendored
12
.github/workflows/deploy.yml
vendored
@ -14,19 +14,11 @@ jobs:
|
|||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: 'recursive'
|
submodules: 'recursive'
|
||||||
|
|
||||||
- name: Install pnpm
|
- uses: ./.github/actions/setup-deps
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version-file: '.nvmrc'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm i
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
|
|||||||
8
.github/workflows/github-pages.yml
vendored
8
.github/workflows/github-pages.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository for Typedoc
|
- name: Checkout repository for Typedoc
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
path: pokerogue_docs
|
path: pokerogue_docs
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ jobs:
|
|||||||
rm -rf assets
|
rm -rf assets
|
||||||
|
|
||||||
- name: Checkout asset submodule
|
- name: Checkout asset submodule
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
repository: 'pagefaultgames/pokerogue-assets'
|
repository: 'pagefaultgames/pokerogue-assets'
|
||||||
ref: ${{ steps.asset-submodule-ref.asset_ref }}
|
ref: ${{ steps.asset-submodule-ref.asset_ref }}
|
||||||
@ -59,13 +59,13 @@ jobs:
|
|||||||
version: 10
|
version: 10
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version-file: "pokerogue_docs/.nvmrc"
|
node-version-file: "pokerogue_docs/.nvmrc"
|
||||||
|
|
||||||
- name: Checkout repository for Github Pages
|
- name: Checkout repository for Github Pages
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
path: pokerogue_gh
|
path: pokerogue_gh
|
||||||
ref: gh-pages
|
ref: gh-pages
|
||||||
|
|||||||
20
.github/workflows/linting.yml
vendored
20
.github/workflows/linting.yml
vendored
@ -25,21 +25,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out Git repository
|
- name: Check out Git repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
|
|
||||||
- name: Set up Node
|
- uses: ./.github/actions/setup-deps
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version-file: ".nvmrc"
|
|
||||||
cache: "pnpm"
|
|
||||||
|
|
||||||
- name: Install Node modules
|
|
||||||
run: pnpm i
|
|
||||||
|
|
||||||
# Lint files with Biome-Lint - https://biomejs.dev/linter/
|
# Lint files with Biome-Lint - https://biomejs.dev/linter/
|
||||||
- name: Lint with Biome
|
- name: Lint with Biome
|
||||||
@ -64,13 +55,6 @@ jobs:
|
|||||||
id: typecheck-scripts
|
id: typecheck-scripts
|
||||||
if: ${{ !cancelled() }}
|
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
|
- name: Check for REUSE compliance
|
||||||
id: reuse-lint
|
id: reuse-lint
|
||||||
uses: fsfe/reuse-action@v5
|
uses: fsfe/reuse-action@v5
|
||||||
|
|||||||
16
.github/workflows/test-shard-template.yml
vendored
16
.github/workflows/test-shard-template.yml
vendored
@ -18,22 +18,12 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out Git repository
|
- name: Check out Git repository
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
|
|
||||||
- name: Install pnpm
|
- uses: ./.github/actions/setup-deps
|
||||||
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
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: >
|
run: >
|
||||||
pnpm test:silent
|
pnpm test:silent
|
||||||
|
|||||||
24
.github/workflows/tests.yml
vendored
24
.github/workflows/tests.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
|||||||
all: ${{ steps.filter.outputs.all }}
|
all: ${{ steps.filter.outputs.all }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout GitHub repository
|
- name: Checkout GitHub repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
sparse-checkout: |
|
sparse-checkout: |
|
||||||
.github/test-filters.yml
|
.github/test-filters.yml
|
||||||
@ -60,28 +60,22 @@ jobs:
|
|||||||
if: ${{ needs.run-tests.result != 'skipped' && needs.run-tests.result != 'cancelled' }}
|
if: ${{ needs.run-tests.result != 'skipped' && needs.run-tests.result != 'cancelled' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out Git repository
|
- name: Check out Git repository
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v6
|
||||||
with:
|
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: ./.github/actions/setup-deps
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version-file: ".nvmrc"
|
|
||||||
cache: "pnpm"
|
|
||||||
|
|
||||||
- name: Install Packages
|
|
||||||
run: pnpm i
|
|
||||||
|
|
||||||
- name: Download blob artifacts
|
- name: Download blob artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v6
|
||||||
with:
|
with:
|
||||||
pattern: shard-?-blob
|
pattern: shard-?-blob
|
||||||
path: test-results
|
path: test-results
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Merge blobs
|
- 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:cov": "vitest run --coverage --no-isolate",
|
||||||
"test:watch": "vitest watch --coverage --no-isolate",
|
"test:watch": "vitest watch --coverage --no-isolate",
|
||||||
"test:silent": "vitest run --silent='passed-only' --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",
|
"test:create": "node scripts/create-test/create-test.js",
|
||||||
"eggMoves:parse": "node scripts/parse-egg-moves/main.js",
|
"eggMoves:parse": "node scripts/parse-egg-moves/main.js",
|
||||||
"scrape-trainers": "node scripts/scrape-trainer-names/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 { defineConfig, loadEnv, type Rollup, type UserConfig } from "vite";
|
||||||
import tsconfigPaths from "vite-tsconfig-paths";
|
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 = {
|
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,
|
clearScreen: false,
|
||||||
appType: "mpa",
|
appType: "mpa",
|
||||||
build: {
|
build: {
|
||||||
@ -41,7 +45,7 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
keepNames: true,
|
keepNames: true,
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
port: !Number.isNaN(envPort) ? envPort : 8000,
|
port: Number.isNaN(envPort) ? 8000 : envPort,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user