Skip to content

Commit 0dc1e98

Browse files
committed
Merge branch 'main' into release-with-main-30-3
2 parents e50043c + 046dbd1 commit 0dc1e98

383 files changed

Lines changed: 15451 additions & 10747 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/compute-artifact-names/action.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ runs:
2121
"linux-x86_64",
2222
"linux-x86_64-static",
2323
"macos-x86_64",
24-
"macos-aarch64",
25-
"macos-universal"
24+
"macos-aarch64"
2625
]'),
2726
inputs.build-name
2827
)
@@ -42,7 +41,7 @@ runs:
4241
4342
- name: Set npm target
4443
id: set-npm-target
45-
if: inputs.build-name != 'all' && inputs.build-name != 'macos-universal'
44+
if: inputs.build-name != 'all'
4645
shell: sh
4746
run: |
4847
case '${{ inputs.build-name }}' in

.github/actions/setup-haskell/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ runs:
4949
# Based on the official recipe for Cabal caching:
5050
# https://github.com/actions/cache/blob/v4.2.3/examples.md#haskell---cabal
5151
- name: Cache Cabal dependencies
52-
uses: actions/cache@v4
52+
uses: actions/cache@v5
5353
with:
5454
# There are two extra directories that are commonly cache, that we've
5555
# decided not to cache:

.github/workflows/ci-deploy-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
name: railway-deploy-test
100100

101101
steps:
102-
- uses: actions/checkout@v5
102+
- uses: actions/checkout@v6
103103

104104
- uses: ./.github/actions/prepare-deploy-test
105105

.github/workflows/ci-formatting.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Run Prettier
2424
run: |
2525
npm ci
26-
npm run prettier:check
26+
npm run check:prettier
2727
2828
ormolu:
2929
runs-on: ubuntu-latest
@@ -44,3 +44,25 @@ jobs:
4444
- uses: haskell-actions/run-ormolu@v15
4545
with:
4646
version: ${{ env.ORMOLU_VERSION }}
47+
48+
cabal-gild:
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- uses: actions/checkout@v6
53+
54+
- name: Parse cabal-gild version
55+
working-directory: waspc
56+
run: |
57+
echo "CABAL_GILD_VERSION=$(grep 'cabal-gild ==' dev-tool.project | sed 's/.*==\s*\([0-9.]*\).*/\1/')" >> $GITHUB_ENV
58+
59+
- uses: tfausak/cabal-gild-setup-action@v2
60+
with:
61+
version: ${{ env.CABAL_GILD_VERSION }}
62+
63+
- name: Run cabal-gild
64+
working-directory: waspc
65+
run: |
66+
for f in $(git ls-files '*.cabal'); do
67+
cabal-gild --mode check --input "$f"
68+
done

.github/workflows/ci-npm-package-build.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
build-name: all
3535

36-
- uses: actions/download-artifact@v6
36+
- uses: actions/download-artifact@v8
3737
with:
3838
path: "./download/"
3939
pattern: ${{ steps.compute-download-artifact-names.outputs.artifact-name }}
@@ -83,13 +83,10 @@ jobs:
8383
working-directory: ./scripts/make-npm-packages
8484
run: npm ci
8585

86-
# NOTE: --experimental-strip-types allows Node to run TypeScript
87-
# directly. This flag became the default in Node v22.18+, but we need
88-
# it explicitly for our minimum supported version (v22.12.0).
8986
- name: Run packager script
90-
run: node --experimental-strip-types ./scripts/make-npm-packages/src/index.ts --input-dir ./input/ --output-dir ./output/
87+
run: node ./scripts/make-npm-packages/src/index.ts --input-dir ./input/ --output-dir ./output/
9188

92-
- uses: actions/upload-artifact@v5
89+
- uses: actions/upload-artifact@v7
9390
with:
9491
name: ${{ vars.WASP_NPM_ARTIFACT_NAME }}
9592
include-hidden-files: true

.github/workflows/ci-npm-package-publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
node-version-file: .nvmrc
1717

18-
- uses: actions/download-artifact@v6
18+
- uses: actions/download-artifact@v8
1919
with:
2020
name: ${{ vars.WASP_NPM_ARTIFACT_NAME }}
2121
path: packages/

.github/workflows/ci-npm-package-test.yaml

Lines changed: 50 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: "Test - Wasp npm packages"
22

33
on:
44
workflow_call:
5+
inputs:
6+
data-files-list:
7+
description: "Expected data files list with per-file SHA-256 hashes."
8+
required: true
9+
type: string
510

611
jobs:
712
test:
@@ -14,7 +19,7 @@ jobs:
1419

1520
- # Linux with Musl
1621
os: ubuntu-latest
17-
container: node:22-alpine
22+
container: node:22-alpine3.23
1823
install-deps: apk add curl
1924

2025
- # Apple Silicon
@@ -31,11 +36,6 @@ jobs:
3136
steps:
3237
- uses: actions/checkout@v6
3338

34-
- uses: actions/download-artifact@v6
35-
with:
36-
name: ${{ vars.WASP_NPM_ARTIFACT_NAME }}
37-
path: packages/
38-
3939
- name: Install dependencies
4040
if: matrix.runner.install-deps
4141
run: ${{ matrix.runner.install-deps }}
@@ -45,43 +45,58 @@ jobs:
4545
with:
4646
node-version-file: .nvmrc
4747

48-
- name: Publish and run Wasp npm packages
48+
- name: Install Wasp CLI from pkg.pr.new
4949
env:
50-
TEST_REGISTRY_URL: http://localhost:4873
51-
TEST_REGISTRY_CONFIG: |
52-
storage: "$HOME/.verdaccio/storage"
53-
log: { type: stdout, format: pretty, level: info }
54-
max_body_size: 1000mb # Needed because Wasp packages are large
55-
packages: { '**': { access: $all, publish: $all } }
50+
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
5651
run: |
5752
set -eux
5853
59-
# Install global packages
60-
npm install -g npm-cli-login@1 verdaccio@6
54+
# Create a test project to install into
55+
mkdir install-test && cd install-test
56+
npm init -y
6157
62-
# Create registry config
63-
mkdir -p "$HOME/.config/verdaccio"
64-
echo "$TEST_REGISTRY_CONFIG" > "$HOME/.config/verdaccio/config.yaml"
58+
# Install the CLI package (its optional deps pull in the
59+
# platform-specific sub-package for this runner).
60+
npm install "https://pkg.pr.new/@wasp.sh/wasp-cli@$COMMIT_SHA"
6561
66-
# Start local registry
67-
verdaccio &
62+
- name: Run Wasp CLI
63+
run: |
64+
set -eux
65+
cd install-test
6866
69-
# Wait for registry to be ready
70-
until curl -sSf "$TEST_REGISTRY_URL/-/ping" >/dev/null; do
71-
sleep 1
72-
done
67+
# Test that the Wasp CLI can find and run the binary.
68+
NODE_DEBUG=wasp-bin-wrapper npx wasp version
7369
74-
# Set registry and login
75-
npm-cli-login -u fake-user -p fake-password -e fake@email.com -r "$TEST_REGISTRY_URL"
76-
npm config set registry "$TEST_REGISTRY_URL"
70+
- name: Generate list of installed data files
71+
run: |
72+
set -eux
7773
78-
# Publish all packages to the test registry
79-
for pkg_dir in ./packages/*; do
80-
npm publish "$pkg_dir"
81-
done
74+
# Find the installed platform sub-package (there should be exactly
75+
# one matching the runner's os/cpu/libc).
76+
pkg_dir=$(ls -d install-test/node_modules/@wasp.sh/wasp-cli-*/data 2>/dev/null | head -1)
77+
78+
if [ -z "$pkg_dir" ]; then
79+
echo "::error::No platform sub-package with data directory found"
80+
exit 1
81+
fi
82+
83+
# Strip the trailing /data to get the package root, then walk the
84+
# data directory and produce a tab-separated manifest of relative
85+
# paths and their SHA-256 hashes.
86+
pkg_root="${pkg_dir%/data}"
87+
(cd "$pkg_root" && find ./data -type f | while IFS= read -r file; do
88+
hash=$(sha256sum "$file" | cut -d' ' -f1)
89+
printf '%s\t%s\n' "$file" "$hash"
90+
done) > actual-data-files.txt
91+
92+
- name: Verify data files match
93+
env:
94+
EXPECTED_DATA_FILES: ${{ inputs.data-files-list }}
95+
run: |
96+
set -eux
8297
83-
# Test installing and using the Wasp CLI from the test registry
84-
# We'll enable debug logging in the wrapper to see if it can find and run the Wasp binary.
85-
NODE_DEBUG=wasp-bin-wrapper npx -y @wasp.sh/wasp-cli version
98+
echo "$EXPECTED_DATA_FILES" > expected-data-files.txt
8699
87-
exit 0 # Done, do not wait for registry to exit
100+
# Both lists are sorted before comparison so file discovery order
101+
# doesn't cause spurious failures.
102+
diff <(sort expected-data-files.txt) <(sort actual-data-files.txt)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Test - Wasp Packages"
2+
3+
on:
4+
workflow_call:
5+
6+
env:
7+
WASP_TELEMETRY_DISABLE: 1
8+
9+
jobs:
10+
test-packages:
11+
name: Test Wasp packages
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- uses: "actions/checkout@v6"
15+
16+
- uses: actions/setup-node@v6
17+
with:
18+
node-version-file: .nvmrc
19+
20+
- name: Test all packages
21+
working-directory: waspc
22+
run: ./run test:packages

.github/workflows/ci-waspc-build.yaml

Lines changed: 30 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ on:
1010
# Don't change this version without updating it in all required
1111
# places (full list in /.nvmrc).
1212
description: "Node.js version to use for building"
13-
default: "22.12.0"
13+
default: "22.22.2"
1414
type: string
1515
required: false
1616
outputs:
1717
waspc_version:
1818
value: ${{ jobs.build.outputs.waspc_version }}
1919
description: "The Wasp version built in this workflow."
20+
data_files_list:
21+
value: ${{ jobs.build.outputs.data_files_list }}
22+
description: "List of data files with per-file SHA-256 hashes."
2023
output_linux-x86_64:
2124
value: ${{ jobs.build.outputs.output_linux-x86_64 }}
2225
description: "The build output metadata for linux-x86_64."
@@ -37,6 +40,7 @@ jobs:
3740
build:
3841
outputs:
3942
waspc_version: ${{ steps.set-outputs.outputs.waspc_version }}
43+
data_files_list: ${{ steps.data-files.outputs.list }}
4044
output_linux-x86_64: ${{ steps.set-outputs.outputs.output_linux-x86_64 }}
4145
output_linux-x86_64-static: ${{ steps.set-outputs.outputs.output_linux-x86_64-static }}
4246
output_macos-x86_64: ${{ steps.set-outputs.outputs.output_macos-x86_64 }}
@@ -83,17 +87,19 @@ jobs:
8387
# We also pin the `alpine` version to a specific one we have tested,
8488
# since newer releases might have different versions of the
8589
# libraries we depend on.
86-
container: node:${{ inputs.node-version }}-alpine3.21
90+
container: node:${{ inputs.node-version }}-alpine3.23
8791
skip-node-install: true
8892
static: true
8993
install-deps: |
9094
apk update
9195
# GHCup dependencies (https://www.haskell.org/ghcup/install/#linux-alpine)
92-
apk add binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl pkgconfig tar xz
96+
apk add binutils-gold curl gcc g++ gmp-dev gmp-static libc-dev libffi-dev make musl-dev ncurses-dev perl pkgconfig tar xz
9397
# `./run` script dependencies
9498
apk add bash
9599
# Cabal dependencies
96100
apk add zlib-dev zlib-static
101+
# Prisma dependencies
102+
apk add openssl
97103
98104
- name: macos-x86_64
99105
runner: macos-15-intel
@@ -141,7 +147,27 @@ jobs:
141147
mkdir -p artifacts
142148
./tools/make_binary_package.sh "artifacts/${{ steps.compute-artifact-names.outputs.tarball-name }}"
143149
144-
- uses: actions/upload-artifact@v4
150+
- name: Compute data files list
151+
id: data-files
152+
working-directory: waspc
153+
run: |
154+
if command -v sha256sum >/dev/null 2>&1; then
155+
HASH_CMD="sha256sum"
156+
else
157+
HASH_CMD="shasum -a 256"
158+
fi
159+
{
160+
echo 'list<<EOF'
161+
cabal sdist --list-only \
162+
| grep '^\./data/' \
163+
| while IFS= read -r file; do
164+
hash=$($HASH_CMD "$file" | cut -d' ' -f1)
165+
printf '%s\t%s\n' "$file" "$hash"
166+
done
167+
echo 'EOF'
168+
} >> $GITHUB_OUTPUT
169+
170+
- uses: actions/upload-artifact@v7
145171
with:
146172
path: ./waspc/artifacts/${{ steps.compute-artifact-names.outputs.tarball-name }}
147173
name: ${{ steps.compute-artifact-names.outputs.artifact-name }}
@@ -158,59 +184,3 @@ jobs:
158184
echo 'EOF'
159185
} >> $GITHUB_OUTPUT
160186
echo "waspc_version=$(cd waspc && ./run get-waspc-version)" >> $GITHUB_OUTPUT
161-
162-
build-universal:
163-
name: Build Wasp (universal)
164-
needs: build
165-
runs-on: macos-15
166-
167-
env:
168-
X86_64_TARBALL_NAME: ${{ fromJson(needs.build.outputs.output_macos-x86_64).tarball-name }}
169-
X86_64_ARTIFACT_NAME: ${{ fromJson(needs.build.outputs.output_macos-x86_64).artifact-name }}
170-
AARCH64_TARBALL_NAME: ${{ fromJson(needs.build.outputs.output_macos-aarch64).tarball-name }}
171-
AARCH64_ARTIFACT_NAME: ${{ fromJson(needs.build.outputs.output_macos-aarch64).artifact-name }}
172-
173-
steps:
174-
- uses: actions/checkout@v6
175-
176-
- name: Compute artifact names
177-
uses: ./.github/actions/compute-artifact-names
178-
id: compute-artifact-names
179-
with:
180-
build-name: macos-universal
181-
182-
- name: Download macOS Intel binaries
183-
uses: actions/download-artifact@v5
184-
with:
185-
name: "${{ env.X86_64_ARTIFACT_NAME }}"
186-
187-
- name: Download macOS ARM binaries
188-
uses: actions/download-artifact@v5
189-
with:
190-
name: "${{ env.AARCH64_ARTIFACT_NAME }}"
191-
192-
- name: Unpack, create universal binary and pack
193-
run: |
194-
set -eux # Fail on error and print each command
195-
196-
mkdir x86_64 aarch64 universal
197-
198-
# Unpack both architectures
199-
tar -xzf "$X86_64_TARBALL_NAME" -C x86_64
200-
tar -xzf "$AARCH64_TARBALL_NAME" -C aarch64
201-
202-
# Create the universal binary
203-
lipo \
204-
-create "x86_64/wasp-bin" "aarch64/wasp-bin" \
205-
-output "universal/wasp-bin"
206-
207-
# Copy the data folder too (we take the first one, should be identical in both)
208-
cp -R "x86_64/data/" "universal/"
209-
210-
# Pack back up
211-
tar -czf ${{ steps.compute-artifact-names.outputs.tarball-name }} -C universal .
212-
213-
- uses: actions/upload-artifact@v4
214-
with:
215-
name: ${{ steps.compute-artifact-names.outputs.artifact-name }}
216-
path: ./${{ steps.compute-artifact-names.outputs.tarball-name }}

0 commit comments

Comments
 (0)