forked from Nexus-Mods/Vortex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
128 lines (110 loc) · 3.46 KB
/
.gitlab-ci.yml
File metadata and controls
128 lines (110 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
stages:
- build
variables:
GIT_SUBMODULE_STRATEGY: recursive
PNPM_CACHE_FOLDER: .pnpm-store
workflow:
auto_cancel:
on_new_commit: interruptible
rules:
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_PIPELINE_SOURCE == "web"
.cache_linux:
cache:
key:
files:
- pnpm-lock.yaml
prefix: linux
paths:
- $PNPM_CACHE_FOLDER
policy: pull-push
.cache_windows:
cache:
key:
files:
- pnpm-lock.yaml
prefix: windows
paths:
- $PNPM_CACHE_FOLDER
policy: pull-push
.build_template:
stage: build
interruptible: true
script:
- pnpm run build:fomod
- pnpm install
- pnpm run build:all
- pnpm run lint:ci
- pnpm run test
# NOTE(erri120): This extracts Stmts from vitest v8 coverage results
# https://regex101.com/r/sPcu5n/1
coverage: '/^All files\s*\|\s*([\d.]+)\s*\|/'
artifacts:
when: always
reports:
junit: test-results/junit.xml
coverage_report:
coverage_format: cobertura
path: test-results/cobertura-coverage.xml
build:linux:
extends:
- .build_template
- .cache_linux
tags:
- nexus_runner
# TODO: use our dockerfile image instead, don't install dependencies.
image: ubuntu:24.04
before_script:
- |
set -euo pipefail
# Install system dependencies
apt-get update && apt-get install -y curl git libfontconfig1-dev ca-certificates xz-utils python3 python3-setuptools build-essential libicu-dev
# Install .NET SDK 9.0
curl -fsSL https://dot.net/v1/dotnet-install.sh | bash -s -- --channel 9.0
export DOTNET_ROOT="$HOME/.dotnet"
export PATH="$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools"
# Install Volta and Node.js/pnpm
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
curl https://get.volta.sh | bash -s -- --skip-setup
volta install node@22 yarn@v1
npm install --global corepack@latest
corepack install
# Configure node-gyp
# (no-op on Linux, native toolchain installed via apt)
# Configure pnpm store
pnpm config set store-dir $PNPM_CACHE_FOLDER
build:windows:
extends:
- .build_template
- .cache_windows
tags:
- windows
# Custom image with VS Build Tools 2022, Git, Python 3.10, .NET SDK 9
# Built from: docker/windows/Dockerfile
image: registry.nexusmods.com/nexusmods/vortex-ci:latest
variables:
GIT_CONFIG_COUNT: "1"
GIT_CONFIG_KEY_0: "core.longpaths"
GIT_CONFIG_VALUE_0: "true"
GIT_CLONE_PATH: $CI_BUILDS_DIR\vortex
ComSpec: C:\Windows\System32\cmd.exe
before_script:
# Enable long path support (>260 chars) system-wide and for Git
- New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1 -PropertyType DWORD -Force
# Install system dependencies
# (pre-installed in registry.nexusmods.com/nexusmods/vortex-ci:latest)
# Install .NET SDK 9.0
# (pre-installed in registry.nexusmods.com/nexusmods/vortex-ci:latest)
# Install Volta and Node.js/pnpm
- volta install node@22 yarn@v1
- npm install --global corepack@latest
- corepack install
# Configure node-gyp
- $env:npm_config_msvs_version = "2022"
- $env:GYP_MSVS_VERSION = "2022"
# Configure pnpm store
- pnpm config set store-dir $env:PNPM_CACHE_FOLDER
# Mark directory as safe for Git
- git config --global --add safe.directory $CI_PROJECT_DIR