Skip to content

Commit

Permalink
chore: initial commit 🌟
Browse files Browse the repository at this point in the history
  • Loading branch information
StarpTech committed Aug 23, 2023
1 parent 4d73e22 commit 748e072
Show file tree
Hide file tree
Showing 673 changed files with 124,266 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
**/node_modules
docker-compose.*
npm-debug.log
coverage
dist
**/.env
**/.env.local
/.github
/.vscode
/build
/.idea
/.husky
docs
demo
cli
**/dist
**/gen
/iac
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
Thank you for your pull request. Please provide a description above and review
the requirements below.
Contributors guide: https://github.com/wundergraph/cloud/blob/main/CONTRIBUTING.md
Squashed commit must follow https://www.conventionalcommits.org/en/v1.0.0/ so we can generate the changelog.
-->

## Motivation and Context

<!--
Why is this change required? What problem does it solve? Which issues are linked?
Please try to describe in detail the impact of this change. Add screenshots if it helps.
-->

- [ ] Tests or benchmark included
- [ ] Documentation is changed or added on [https://app.gitbook.com/](https://app.gitbook.com/)
- [ ] PR title must follow [conventional-commit-standard](https://github.com/wundergraph/wundergraph/blob/main/CONTRIBUTING.md#conventional-commit-standard)
21 changes: 21 additions & 0 deletions .github/actions/go/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Setup Go"
description: "This action install go and cache modules and build dependencies"
inputs:
go-version:
description: "The go version to install"
default: "1.20"
required: false
working-directory:
description: "The working directory"
required: false
gh-engine-repo-token:
description: "Temporary token for private engine"
required: true

runs:
using: "composite"
steps:
- uses: actions/setup-go@v4
with:
go-version: ${{ inputs.go-version }}
cache-dependency-path: ${{ inputs.cache-dependency-path }}
42 changes: 42 additions & 0 deletions .github/actions/node/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Setup Node"
description: "This action install node and cache modules. It uses pnpm as package manager."
inputs:
node-version:
description: "The node version to install (Default: lts)"
default: "lts/*"
required: false
working-directory:
description: "The working directory of your node package"
default: "."
required: false

runs:
using: "composite"
steps:
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}

- uses: pnpm/action-setup@v2.2.4
id: pnpm-install
with:
version: 8.6.10
run_install: false

- name: Get pnpm store directory
shell: bash
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-8-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-8-store-
- name: setup pnpm config registry
run: pnpm config set registry https://registry.npmjs.org
shell: bash
17 changes: 17 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
studio:
- "studio/**/*"
monorepo:
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "package.json"
- "Makefile"
cli:
- "cli/**/*"
router:
- "router/**/*"
connect:
- "connect/**/*"
protocol:
- "proto/**/*"
controlplane:
- "controlplane/**/*"
48 changes: 48 additions & 0 deletions .github/workflows/cli-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Cli CI
on:
push:
branches:
- main
tags-ignore:
- "**"
paths:
- "cli/**/*"
- "connect/**/*"
- ".github/workflows/cli-ci.yaml"

pull_request:
branches:
- main
paths:
- "cli/**/*"
- "connect/**/*"
- ".github/workflows/cli-ci.yaml"

concurrency:
group: ${{github.workflow}}-${{github.head_ref}}
cancel-in-progress: true

env:
CI: true

jobs:
build_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: ./.github/actions/node

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Generate code
run: pnpm buf generate --template buf.ts.gen.yaml

- name: Build
run: pnpm run --filter ./cli --filter ./connect --filter ./shared --filter ./composition build

- name: Test
run: pnpm run --filter wgc test
45 changes: 45 additions & 0 deletions .github/workflows/composition-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Composition CI
on:
push:
branches:
- main
tags-ignore:
- "**"
paths:
- "composition/**/*"
- ".github/workflows/composition-ci.yaml"

pull_request:
branches:
- main
- "composition/**/*"
- ".github/workflows/composition-ci.yaml"

concurrency:
group: ${{github.workflow}}-${{github.head_ref}}
cancel-in-progress: true

env:
CI: true

jobs:
build_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: ./.github/actions/node

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Generate code
run: pnpm buf generate --template buf.ts.gen.yaml

- name: Build
run: pnpm run --filter ./composition --filter ./connect --filter ./shared build

- name: Test
run: pnpm run --filter composition test
67 changes: 67 additions & 0 deletions .github/workflows/cp-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Controlplane CI
on:
push:
branches:
- main
tags-ignore:
- "**"
paths:
- "controlplane/**/*"
- "connect/**/*"
- "composition/**/*"
- ".github/workflows/cp-ci.yaml"

pull_request:
branches:
- main
paths:
- "controlplane/**/*"
- "connect/**/*"
- "composition/**/*"
- ".github/workflows/cp-ci.yaml"

concurrency:
group: ${{github.workflow}}-${{github.head_ref}}
cancel-in-progress: true

env:
CI: true

jobs:
build_test:
runs-on: ubuntu-latest
services:
postgres:
# Docker Hub image
image: postgres:14
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: changeme
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: ./.github/actions/node

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Generate code
run: pnpm buf generate --template buf.ts.gen.yaml

- name: Build
run: pnpm run --filter ./controlplane --filter ./connect --filter ./shared --filter ./composition build

- name: Test
run: pnpm run --filter controlplane test
env:
DB_URL: "postgresql://postgres:changeme@localhost:5432/controlplane"
64 changes: 64 additions & 0 deletions .github/workflows/images-tags.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: Build and publish Docker images on tags

on:
push:
tags:
- 'v*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image-tags:
strategy:
matrix:
include:
- container_name: controlplane
dockerfile: controlplane/Dockerfile
context_path: .
- container_name: router
dockerfile: router/Dockerfile
context_path: .
- container_name: studio
dockerfile: studio/Dockerfile
context_path: .

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.container_name }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,format=long,prefix=sha256-
- name: Install Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
push: true
file: ${{ matrix.dockerfile }}
context: ${{ matrix.context_path }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Loading

0 comments on commit 748e072

Please sign in to comment.