Skip to content
Closed
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
67 changes: 35 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,110 +3,113 @@
on:
push:
branches: [master, release/*]
paths-ignore:
- "**.md"
- "docs/**"
- "locales/**"
- ".devcontainer/**"
- "docker/**"
- "flatpak/**"
- "*.nix"
- "flake.*"
- "default.nix"
- "shell.nix"
- ".env.example"
- ".envrc"
- ".editorconfig"
- "vortex.bat"
- "translation-strings.txt"
pull_request:
branches: [master, release/*]
paths-ignore:
- "**.md"
- "docs/**"
- "locales/**"
- ".devcontainer/**"
- "docker/**"
- "flatpak/**"
- "*.nix"
- "flake.*"
- "default.nix"
- "shell.nix"
- ".env.example"
- ".envrc"
- ".editorconfig"
- "vortex.bat"
- "translation-strings.txt"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# Required status checks stay "Expected" forever when a workflow is skipped by
# paths-ignore, so filter inside the workflow instead: a skipped job reports success.
changes:
runs-on: ubuntu-latest
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
- uses: actions/checkout@v7

- uses: dorny/paths-filter@v4
id: filter
with:
predicate-quantifier: every
filters: |
code:
- "!**.md"
- "!docs/**"
- "!locales/**"
- "!.devcontainer/**"
- "!docker/**"
- "!flatpak/**"
- "!*.nix"
- "!flake.*"
- "!default.nix"
- "!shell.nix"
- "!.env.example"
- "!.envrc"
- "!.editorconfig"
- "!vortex.bat"
- "!translation-strings.txt"

build:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
needs: changes
# Fails open: if the filter job itself fails, code is empty and the full build runs.
if: ${{ !cancelled() && (github.event_name == 'workflow_dispatch' || needs.changes.outputs.code != 'false') }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
with:
submodules: "recursive"

- name: Setup Python 3.11
uses: actions/setup-python@v7
with:
python-version: "3.11"

- name: Install pnpm
uses: ./.github/actions/setup-pnpm

# NOTE(erri120): fontconfig required by font-scanner required by theme-switcher
- name: Install fontconfig
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev

- name: Install dependencies
run: pnpm install
env:
VORTEX_ELECTRON_REBUILD: "defer"

- name: Cache native build headers
uses: actions/cache@v6
with:
path: |
~/.electron-gyp
~/.cache/node-gyp
key: native-headers-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json', 'pnpm-lock.yaml') }}

- name: Cache Electron native rebuild outputs
id: electron-native-cache
uses: actions/cache@v6
with:
path: |
node_modules/.pnpm/@nexusmods+fomod-installer-native@*/node_modules/@nexusmods/fomod-installer-native/build
node_modules/.pnpm/@nexusmods+fomod-installer-native@*/node_modules/@nexusmods/fomod-installer-native/bin
node_modules/.pnpm/drivelist@*/node_modules/drivelist/build
node_modules/.pnpm/drivelist@*/node_modules/drivelist/bin
node_modules/.pnpm/leveldown@*/node_modules/leveldown/build
node_modules/.pnpm/leveldown@*/node_modules/leveldown/bin
node_modules/.pnpm/winapi-bindings@*/node_modules/winapi-bindings/build
node_modules/.pnpm/winapi-bindings@*/node_modules/winapi-bindings/bin
node_modules/.pnpm/xxhash-addon@*/node_modules/xxhash-addon/build
node_modules/.pnpm/xxhash-addon@*/node_modules/xxhash-addon/bin
node_modules/.pnpm/@parcel+watcher@*/node_modules/@parcel/watcher/build
node_modules/.pnpm/@parcel+watcher@*/node_modules/@parcel/watcher/bin
key: electron-native-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'src/main/postinstall.mjs') }}

- name: Rebuild Electron native modules
run: |
echo "Electron native cache hit: ${{ steps.electron-native-cache.outputs.cache-hit }}"
pnpm --filter @vortex/main exec electron-rebuild

- name: Build
run: pnpm run build

- name: Test
run: pnpm run test

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}