Skip to content

Commit 748e072

Browse files
committed
chore: initial commit 🌟
1 parent 4d73e22 commit 748e072

File tree

673 files changed

+124266
-0
lines changed

Some content is hidden

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

673 files changed

+124266
-0
lines changed

.dockerignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
**/node_modules
2+
docker-compose.*
3+
npm-debug.log
4+
coverage
5+
dist
6+
**/.env
7+
**/.env.local
8+
/.github
9+
/.vscode
10+
/build
11+
/.idea
12+
/.husky
13+
docs
14+
demo
15+
cli
16+
**/dist
17+
**/gen
18+
/iac

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!--
2+
Thank you for your pull request. Please provide a description above and review
3+
the requirements below.
4+
5+
Contributors guide: https://github.com/wundergraph/cloud/blob/main/CONTRIBUTING.md
6+
Squashed commit must follow https://www.conventionalcommits.org/en/v1.0.0/ so we can generate the changelog.
7+
-->
8+
9+
## Motivation and Context
10+
11+
<!--
12+
Why is this change required? What problem does it solve? Which issues are linked?
13+
Please try to describe in detail the impact of this change. Add screenshots if it helps.
14+
-->
15+
16+
- [ ] Tests or benchmark included
17+
- [ ] Documentation is changed or added on [https://app.gitbook.com/](https://app.gitbook.com/)
18+
- [ ] PR title must follow [conventional-commit-standard](https://github.com/wundergraph/wundergraph/blob/main/CONTRIBUTING.md#conventional-commit-standard)

.github/actions/go/action.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Setup Go"
2+
description: "This action install go and cache modules and build dependencies"
3+
inputs:
4+
go-version:
5+
description: "The go version to install"
6+
default: "1.20"
7+
required: false
8+
working-directory:
9+
description: "The working directory"
10+
required: false
11+
gh-engine-repo-token:
12+
description: "Temporary token for private engine"
13+
required: true
14+
15+
runs:
16+
using: "composite"
17+
steps:
18+
- uses: actions/setup-go@v4
19+
with:
20+
go-version: ${{ inputs.go-version }}
21+
cache-dependency-path: ${{ inputs.cache-dependency-path }}

.github/actions/node/action.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Setup Node"
2+
description: "This action install node and cache modules. It uses pnpm as package manager."
3+
inputs:
4+
node-version:
5+
description: "The node version to install (Default: lts)"
6+
default: "lts/*"
7+
required: false
8+
working-directory:
9+
description: "The working directory of your node package"
10+
default: "."
11+
required: false
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: ${{ inputs.node-version }}
19+
20+
- uses: pnpm/[email protected]
21+
id: pnpm-install
22+
with:
23+
version: 8.6.10
24+
run_install: false
25+
26+
- name: Get pnpm store directory
27+
shell: bash
28+
id: pnpm-cache
29+
run: |
30+
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
31+
32+
- uses: actions/cache@v3
33+
name: Setup pnpm cache
34+
with:
35+
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
36+
key: ${{ runner.os }}-pnpm-8-store-${{ hashFiles('**/pnpm-lock.yaml') }}
37+
restore-keys: |
38+
${{ runner.os }}-pnpm-8-store-
39+
40+
- name: setup pnpm config registry
41+
run: pnpm config set registry https://registry.npmjs.org
42+
shell: bash

.github/labeler.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
studio:
2+
- "studio/**/*"
3+
monorepo:
4+
- "pnpm-lock.yaml"
5+
- "pnpm-workspace.yaml"
6+
- "package.json"
7+
- "Makefile"
8+
cli:
9+
- "cli/**/*"
10+
router:
11+
- "router/**/*"
12+
connect:
13+
- "connect/**/*"
14+
protocol:
15+
- "proto/**/*"
16+
controlplane:
17+
- "controlplane/**/*"

.github/workflows/cli-ci.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Cli CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags-ignore:
7+
- "**"
8+
paths:
9+
- "cli/**/*"
10+
- "connect/**/*"
11+
- ".github/workflows/cli-ci.yaml"
12+
13+
pull_request:
14+
branches:
15+
- main
16+
paths:
17+
- "cli/**/*"
18+
- "connect/**/*"
19+
- ".github/workflows/cli-ci.yaml"
20+
21+
concurrency:
22+
group: ${{github.workflow}}-${{github.head_ref}}
23+
cancel-in-progress: true
24+
25+
env:
26+
CI: true
27+
28+
jobs:
29+
build_test:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v3
33+
with:
34+
fetch-depth: 0
35+
36+
- uses: ./.github/actions/node
37+
38+
- name: Install dependencies
39+
run: pnpm install --frozen-lockfile
40+
41+
- name: Generate code
42+
run: pnpm buf generate --template buf.ts.gen.yaml
43+
44+
- name: Build
45+
run: pnpm run --filter ./cli --filter ./connect --filter ./shared --filter ./composition build
46+
47+
- name: Test
48+
run: pnpm run --filter wgc test
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Composition CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags-ignore:
7+
- "**"
8+
paths:
9+
- "composition/**/*"
10+
- ".github/workflows/composition-ci.yaml"
11+
12+
pull_request:
13+
branches:
14+
- main
15+
- "composition/**/*"
16+
- ".github/workflows/composition-ci.yaml"
17+
18+
concurrency:
19+
group: ${{github.workflow}}-${{github.head_ref}}
20+
cancel-in-progress: true
21+
22+
env:
23+
CI: true
24+
25+
jobs:
26+
build_test:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v3
30+
with:
31+
fetch-depth: 0
32+
33+
- uses: ./.github/actions/node
34+
35+
- name: Install dependencies
36+
run: pnpm install --frozen-lockfile
37+
38+
- name: Generate code
39+
run: pnpm buf generate --template buf.ts.gen.yaml
40+
41+
- name: Build
42+
run: pnpm run --filter ./composition --filter ./connect --filter ./shared build
43+
44+
- name: Test
45+
run: pnpm run --filter composition test

.github/workflows/cp-ci.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Controlplane CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags-ignore:
7+
- "**"
8+
paths:
9+
- "controlplane/**/*"
10+
- "connect/**/*"
11+
- "composition/**/*"
12+
- ".github/workflows/cp-ci.yaml"
13+
14+
pull_request:
15+
branches:
16+
- main
17+
paths:
18+
- "controlplane/**/*"
19+
- "connect/**/*"
20+
- "composition/**/*"
21+
- ".github/workflows/cp-ci.yaml"
22+
23+
concurrency:
24+
group: ${{github.workflow}}-${{github.head_ref}}
25+
cancel-in-progress: true
26+
27+
env:
28+
CI: true
29+
30+
jobs:
31+
build_test:
32+
runs-on: ubuntu-latest
33+
services:
34+
postgres:
35+
# Docker Hub image
36+
image: postgres:14
37+
ports:
38+
- 5432:5432
39+
env:
40+
POSTGRES_USER: postgres
41+
POSTGRES_PASSWORD: changeme
42+
# Set health checks to wait until postgres has started
43+
options: >-
44+
--health-cmd pg_isready
45+
--health-interval 10s
46+
--health-timeout 5s
47+
--health-retries 5
48+
steps:
49+
- uses: actions/checkout@v3
50+
with:
51+
fetch-depth: 0
52+
53+
- uses: ./.github/actions/node
54+
55+
- name: Install dependencies
56+
run: pnpm install --frozen-lockfile
57+
58+
- name: Generate code
59+
run: pnpm buf generate --template buf.ts.gen.yaml
60+
61+
- name: Build
62+
run: pnpm run --filter ./controlplane --filter ./connect --filter ./shared --filter ./composition build
63+
64+
- name: Test
65+
run: pnpm run --filter controlplane test
66+
env:
67+
DB_URL: "postgresql://postgres:changeme@localhost:5432/controlplane"

.github/workflows/images-tags.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
name: Build and publish Docker images on tags
3+
4+
on:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
build-and-push-image-tags:
15+
strategy:
16+
matrix:
17+
include:
18+
- container_name: controlplane
19+
dockerfile: controlplane/Dockerfile
20+
context_path: .
21+
- container_name: router
22+
dockerfile: router/Dockerfile
23+
context_path: .
24+
- container_name: studio
25+
dockerfile: studio/Dockerfile
26+
context_path: .
27+
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
packages: write
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v3
36+
37+
- name: Log in to the Container registry
38+
uses: docker/login-action@v2
39+
with:
40+
registry: ${{ env.REGISTRY }}
41+
username: ${{ github.actor }}
42+
password: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Extract metadata (tags, labels) for Docker
45+
id: meta
46+
uses: docker/metadata-action@v4
47+
with:
48+
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.container_name }}
49+
tags: |
50+
type=semver,pattern={{version}}
51+
type=semver,pattern={{major}}.{{minor}}
52+
type=sha,format=long,prefix=sha256-
53+
54+
- name: Install Docker Buildx
55+
uses: docker/setup-buildx-action@v2
56+
57+
- name: Build and push Docker image
58+
uses: docker/build-push-action@v4
59+
with:
60+
push: true
61+
file: ${{ matrix.dockerfile }}
62+
context: ${{ matrix.context_path }}
63+
tags: ${{ steps.meta.outputs.tags }}
64+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)