Skip to content

Commit b5e837a

Browse files
committed
ci: Add ci stage that checks wasm compilation. Add WASI badge to README.
1 parent 6cbaae0 commit b5e837a

5 files changed

Lines changed: 37 additions & 8 deletions

File tree

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
test:
1515
uses: graphqlswift/ci/.github/workflows/test.yaml@main
1616
with:
17-
include_android: false
17+
include_android: false

.github/workflows/wasm.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: wasm
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
# NOTE: swift tests won't compile due to usage
12+
# of NIOPosix. But we can at least test that wasm compilation
13+
# works, to prevent future breakages.
14+
wasm:
15+
name: Test wasm compilation
16+
runs-on: ubuntu-latest
17+
container: swift:6.1.0
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
- uses: swiftwasm/setup-swiftwasm@v2
22+
with:
23+
target: "wasm32-unknown-wasip1-threads"
24+
- run: swift build --swift-sdk wasm32-unknown-wasip1-threads

Package.resolved

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ let package = Package(
1313
dependencies: [
1414
.package(url: "https://github.com/apple/swift-algorithms.git", from: "1.0.0"),
1515
.package(url: "https://github.com/adam-fowler/async-collections", from: "0.0.1"),
16-
.package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0"),
16+
17+
// TODO: SM: Revert before merging. Temporarily using PL nio to test fix for NIOCore.
18+
// .package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0"),
19+
.package(url: "https://github.com/PassiveLogic/swift-nio.git", branch: "main"),
1720
],
1821
targets: [
1922
.target(

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](https://tldrlegal.com/license/mit-license)
44
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FGraphQLSwift%2FDataLoader%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/GraphQLSwift/DataLoader)
55
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FGraphQLSwift%2FDataLoader%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/GraphQLSwift/DataLoader)
6+
[![WASI 0.1](https://github.com/GraphQLSwift/DataLoader/actions/workflows/wasm.yml/badge.svg?branch=main)](https://github.com/GraphQLSwift/DataLoader/actions/workflows/wasm.yml)
67

78
DataLoader is a generic utility to be used as part of your application's data fetching layer to provide a simplified and consistent API over various remote data sources such as databases or web services via batching and caching.
89

0 commit comments

Comments
 (0)