Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
Signed-off-by: ThatsItForTheOtherOne <[email protected]>
  • Loading branch information
ThatsItForTheOtherOne authored Dec 30, 2024
2 parents 86b12a8 + f0849e9 commit 2891dde
Show file tree
Hide file tree
Showing 201 changed files with 28,630 additions and 17,582 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

699 changes: 0 additions & 699 deletions .eslintrc.json

This file was deleted.

17 changes: 17 additions & 0 deletions .github/actionlint-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "actionlint",
"pattern": [
{
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}
25 changes: 25 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Setup
description: Setup the workspace for the CI
runs:
using: "composite"
steps:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"

- name: Restore dependencies
id: restore-dependencies
uses: actions/cache@v4
with:
path: node_modules
key: js-depend-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
if: steps.restore-dependencies.outputs.cache-hit != 'true'
shell: bash
run: npm ci

- name: Build third-party libraries
shell: bash
run: npm run build:libs
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ updates:
# These dependencies should be updated manually:
- dependency-name: "vitest"
# Benchmarking is an experimental feature in vitest:
# https://github.com/themoeway/yomitan/pull/583#issuecomment-1925047371
# https://github.com/yomidevs/yomitan/pull/583#issuecomment-1925047371
- dependency-name: "@vitest/coverage-v8"
# Pinned to stay on the same version as vitest
- dependency-name: "@types/node"
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint GitHub Actions workflows
on: [push, pull_request]

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check workflow files
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/v1.7.4/scripts/download-actionlint.bash)
./actionlint -color
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/auto-approve-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.actor == 'djahandarie'
steps:
- name: Download workflow artifact
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6
uses: dawidd6/action-download-artifact@80620a5d27ce0ae443b965134db88467fc607b43 # v7
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: auto-approve.yml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
shell: bash
env:
PR_NUM: ${{ github.event.number }}
run: echo $PR_NUM > pr_num.txt
run: echo "$PR_NUM" > pr_num.txt
- name: Upload the PR number
uses: actions/upload-artifact@v4
with:
name: pr_num
path: ./pr_num.txt
path: ./pr_num.txt
32 changes: 0 additions & 32 deletions .github/workflows/bench.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/broken-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: npm ci
- name: Build Legal
run: npm run license-report:html
- uses: lycheeverse/lychee-action@v1.10.0
- uses: lycheeverse/lychee-action@v2.1.0
with:
fail: true
jobSummary: false
Expand Down
121 changes: 47 additions & 74 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,89 +10,48 @@ on:
merge_group:

jobs:
static-analysis:
name: Static Analysis
tests:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"

- name: Install dependencies
run: npm ci
strategy:
matrix:
include:
- name: JavaScript
test: test:js
- name: TypeScript (main)
test: test:ts:main
- name: TypeScript (dev)
test: test:ts:dev
- name: TypeScript (test)
test: test:ts:test
- name: TypeScript (bench)
test: test:ts:bench
- name: CSS
test: test:css
- name: HTML
test: test:html
- name: Markdown
test: test:md
- name: JSON
test: test:json
- name: Unit Tests
test: test:unit
- name: Unit Tests (options)
test: test:unit:options

- name: Build third-party libraries
run: npm run build:libs

- name: Run static analysis tests
run: npm run test:static-analysis

static-analysis-json:
name: Static Analysis (JSON)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"

- name: Install dependencies
run: npm ci

- name: Build third-party libraries
run: npm run build:libs

- name: Run static analysis tests
run: npm run test:json

unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"

- name: Install dependencies
run: npm ci

- name: Build third-party libraries
run: npm run build:libs

- name: Run unit tests
run: npm run test:unit

- name: Run unit tests (options)
run: npm run test:unit:options
- name: Run ${{ matrix.name }} tests
run: npm run ${{ matrix.test }}

test-build:
name: Test Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"

- name: Install dependencies
run: npm ci

- name: Build Libs
run: npm run build:libs
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Build Legal
run: npm run license-report:html
Expand All @@ -106,3 +65,17 @@ jobs:
file: ext/manifest.json
schema: "https://json.schemastore.org/chrome-manifest.json"
fixSchemas: true

bench:
name: Benchmarks
runs-on: ubuntu-latest
if: github.event_name != 'merge_group'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Run Benchmarks
uses: CodSpeedHQ/action@513a19673a831f139e8717bf45ead67e47f00044 # v3.2
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: npm run bench
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.26.6
uses: github/codeql-action/init@v3.27.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -65,7 +65,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3.26.6
uses: github/codeql-action/autobuild@v3.27.5

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -78,6 +78,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.26.6
uses: github/codeql-action/analyze@v3.27.5
with:
category: "/language:${{matrix.language}}"
6 changes: 4 additions & 2 deletions .github/workflows/create-prerelease-on-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
with:
node-version-file: "package.json"

# intentially do not use cache to keep the build more comprehensible and sandboxed
- name: Install dependencies
run: npm ci

Expand All @@ -36,11 +37,11 @@ jobs:
id: hash
run: |
cd builds
echo "hashes=$(sha256sum * | base64 -w0)" >> "$GITHUB_OUTPUT"
echo "hashes=$(sha256sum -- * | base64 -w0)" >> "$GITHUB_OUTPUT"
- name: Release
id: release
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # pin@v2
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # pin@v2
with:
generate_release_notes: true
prerelease: true
Expand All @@ -52,6 +53,7 @@ jobs:
workflow: publish-chrome-development
token: ${{ secrets.GITHUB_TOKEN }}
wait-for-completion: false
inputs: '{ "upload_url": "${{ steps.release.outputs.upload_url }}" }'

- name: Dispatch publish-firefox-development
uses: aurelien-baudet/workflow-dispatch@3133c5d135c7dbe4be4f9793872b6ef331b53bc7 # pin@v2
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/delay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,5 @@ jobs:
inputs: |
{
"attemptNumber": "${{ github.event.inputs.attemptNumber }}",
"maxAttempts": "${{ github.event.inputs.maxAttempts }}",
"environment": "${{ github.event.inputs.environment }}"
"maxAttempts": "${{ github.event.inputs.maxAttempts }}"
}
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: 'Dependency Review'
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
20 changes: 10 additions & 10 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ jobs:
packages: fonts-ipafont-mincho
execute_install_scripts: true

- uses: actions/setup-node@v4
with:
cache: "npm"
node-version-file: "package.json"

- name: Install dependencies
run: npm ci
- uses: ./.github/actions/setup

- name: Build
run: npm run build
Expand All @@ -52,17 +46,17 @@ jobs:
- name: Grab latest dictionaries from dictionaries branch
uses: actions/checkout@v4
with:
repository: themoeway/yomitan # so that this works on forks
repository: yomidevs/yomitan # so that this works on forks
ref: dictionaries
path: dictionaries

- name: Grab latest screenshots from master branch
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # pin@v2
uses: dawidd6/action-download-artifact@80620a5d27ce0ae443b965134db88467fc607b43 # pin@v2
continue-on-error: true
id: master-screenshots
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repo: themoeway/yomitan # so that this works on forks
repo: yomidevs/yomitan # so that this works on forks
name: playwright-screenshots
branch: master
workflow: playwright.yml
Expand Down Expand Up @@ -106,3 +100,9 @@ jobs:
name: playwright-output
path: playwright-output
if: github.event_name == 'pull_request'

- uses: actions/upload-artifact@v4
with:
name: playwright-results-json
path: playwright-results.json
if: github.event_name == 'pull_request'
Loading

0 comments on commit 2891dde

Please sign in to comment.