Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ concurrency:
cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch }}

jobs:
lint:
checks:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Use Node.js
id: setup-node
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: '.nvmrc'
Expand All @@ -31,11 +32,28 @@ jobs:
- name: Install deps
run: npm ci

- name: Check Electron node version
shell: bash
env:
EXPECTED_NODE_VERSION: ${{ steps.setup-node.outputs.node-version }}
run: |
electron_node_version=$(ELECTRON_RUN_AS_NODE=true npx electron -e 'console.log(process.versions.node);')

# Version string from setup-node is prefixed with "v"
if [[ "v$electron_node_version" == "$EXPECTED_NODE_VERSION" ]]
then
echo "✅ Electron node version matches expected ($electron_node_version)"
else
echo "⛔️ Electron node version ($electron_node_version) does not match expected ($EXPECTED_NODE_VERSION)"
exit 1
fi

- name: Build translations
run: node --run intl

- name: Run lint
run: node --run lint
- name: Run checks
run: node --run checks

test:
timeout-minutes: 10
strategy:
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
"intl:renderer": "node --run \"intl:renderer:extract\" && node --run \"intl:renderer:compile\"",
"intl:generate-translated-languages-list": "node scripts/generate-translated-languages-list.js",
"intl": "concurrently --pad-prefix \"node:intl:renderer\" \"node:intl:main\" && node --run \"intl:generate-translated-languages-list\"",
"lint:eslint": "eslint --cache .",
"lint:format": "prettier --cache --check .",
"lint:knip": "knip",
"lint": "concurrently --prefix \"lint:{name}\" --pad-prefix --group \"node:lint:*\"",
"checks:eslint": "eslint --cache .",
"checks:format": "prettier --cache --check .",
"checks:knip": "knip",
"checks": "concurrently --prefix \"checks:{name}\" --pad-prefix --group \"node:checks:*\"",
"types:root": "tsc -p tsconfig.json",
"types:shared": "tsc -p src/shared/tsconfig.json",
"types:main": "tsc -p src/main/tsconfig.json",
Expand Down
Loading