Repository navigation
138 lines (122 loc) · 4.27 KB
/
Copy pathci-profiles.yml
File metadata and controls
138 lines (122 loc) · 4.27 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
129
130
131
132
133
134
135
136
137
138
name: CI Profiles (L3)
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
push:
branches: [main]
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
generate:
name: Generate profile matrix
runs-on: ubuntu-latest
timeout-minutes: 20
outputs:
matrix: ${{ steps.set.outputs.matrix }}
count: ${{ steps.set.outputs.count }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4.3.1
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Cache pip
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('scripts/ci/requirements.txt') }}
restore-keys: |
pip-
- name: Install CI helpers
run: pip install -r scripts/ci/requirements.txt
- name: Generate L3 matrix
id: set
env:
BASE_REF: ${{ github.base_ref }}
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
BASE="origin/${BASE_REF}"
git fetch origin "${BASE_REF}" --depth=1 || true
python scripts/ci/generate-matrix.py --layer profiles --changed-only --base-ref "$BASE"
else
python scripts/ci/generate-matrix.py --layer profiles
fi
profiles:
name: ${{ matrix.cell.id }}
needs: generate
if: needs.generate.outputs.count != '0'
strategy:
fail-fast: false
matrix:
cell: ${{ fromJson(needs.generate.outputs.matrix) }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4.3.1
with:
persist-credentials: false
- name: Set up V (master, latest)
# CVA tracks the latest master of vlang/v — no pinned compiler.
# check-latest forces setup-v to resolve the newest master commit
# even when its build cache is warm.
uses: vlang/setup-v@f39f0937037ba37f04636f065002867f28c51cc8
with:
version: master
check-latest: true
- name: Cache V modules
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.vmodules
key: vmodules-${{ hashFiles('**/v.mod') }}
restore-keys: |
vmodules-
- name: Install Python helpers
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Cache pip
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('scripts/ci/requirements.txt') }}
restore-keys: |
pip-
- name: Install CI helpers
run: pip install -r scripts/ci/requirements.txt
- name: Install published create-vlang-app CLI
run: bash scripts/ci/install-cva-cli.sh
- name: Scaffold check (curated profile)
env:
CI: "true"
CVA_SKIP_GIT: "1"
# Space-joined addon list via env: the value is data, never
# re-parsed as script; `set -f` also disables glob expansion
# of URLs during splitting (see #121).
ADDON_URLS: ${{ join(matrix.cell.addons, ' ') }}
run: |
ADDON_ARGS=()
set -f
# Deliberately unquoted: split env value on whitespace (URLs
# never contain spaces). No globbing (set -f), no command
# substitution (never performed on variable expansion).
# shellcheck disable=SC2086
for url in $ADDON_URLS; do
ADDON_ARGS+=(--addon-url "$url")
done
set +f
python scripts/ci/run-scaffold-check.py \
--template-url "${{ matrix.cell.templateUrl }}" \
--workdir "${{ runner.temp }}/cva-l3" \
"${ADDON_ARGS[@]}"