Skip to content

Commit

Permalink
Merge branch 'main' into jairus/hyp-2207-create-hypermode-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
JairusSW authored Oct 5, 2024
2 parents 3f32f2f + 421ab23 commit 21d94a4
Show file tree
Hide file tree
Showing 590 changed files with 59,274 additions and 1,820 deletions.
10 changes: 0 additions & 10 deletions .dockerignore

This file was deleted.

6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CODEOWNERS info: https://help.github.com/en/articles/about-code-owners
# Owners are automatically requested for review for PRs that changes code
# that they own.
* @hypermodeAI/runtime
# Owners are automatically requested for review for PRs that changes code that they own.

* @hypermodeinc/modus
39 changes: 33 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
version: 2
updates:
- package-ecosystem: "gomod"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "wednesday"
time: "16:00"
groups:
actions:
update-types:
- "patch"
- "minor"
- "major"

- package-ecosystem: "gomod"
directories:
- "/"
- "/runtime"
- "/runtime/languages/golang/testdata"
- "/sdk/go"
- "/sdk/go/examples/*"
- "/sdk/go/tools/modus-go-build"
schedule:
interval: "weekly"
day: "wednesday"
Expand All @@ -13,15 +32,23 @@ updates:
- "minor"
- "patch"

- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: "npm"
versioning-strategy: increase
directories:
- "/sdk/assemblyscript/src"
- "/sdk/assemblyscript/examples/*"
- "/runtime/languages/assemblyscript/testdata"
schedule:
interval: "weekly"
day: "wednesday"
time: "16:00"
groups:
actions:
minor-and-patch:
applies-to: version-updates
update-types:
- "patch"
- "minor"
- "major"
- "patch"
ignore:
# We target Node.js 20
- dependency-name: "@types/node"
versions: [">= 21.0.0"]
53 changes: 4 additions & 49 deletions .github/workflows/cd-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,58 +14,12 @@ on:
description: "releasetag"
required: true
type: string
push:
branches:
- main
env:
GOPRIVATE: "github.com/dgraph-io/*,github.com/gohypermode/*,github.com/hypermodeAI/*"
GOPRIVATE: "github.com/hypermodeinc/*"
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
runtime-build-push:
if: ${{ github.event_name == 'push' }}
environment: stage
runs-on: warp-ubuntu-latest-x64-16x
steps:
- name: Configure git for private modules
env:
TOKEN: ${{ secrets.GO_PRIVATE_MODULES }}
run: git config --global url."https://admin-hypermode:${TOKEN}@github.com".insteadOf "https://github.com"
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
check-latest: true
- name: Runtime Git SHA
run: |
RUNTIME_GIT_SHA=$(git rev-parse --short HEAD)
echo "runtime git sha "$RUNTIME_GIT_SHA
echo "RUNTIME_GIT_SHA=$RUNTIME_GIT_SHA" >> $GITHUB_ENV
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: "${{ vars.AWS_ROLE }}"
role-session-name: CD_RUNTIME
aws-region: "${{ vars.AWS_REGION }}"
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push runtime docker image
uses: docker/build-push-action@v6
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
push: true
# see https://github.com/docker/build-push-action/issues/755 for why provenance=false
provenance: false
tags: |
${{ vars.AWS_ACCOUNT_ID }}.dkr.ecr.${{ vars.AWS_REGION }}.amazonaws.com/hypermode/runtime:main-${{ env.RUNTIME_GIT_SHA }}
${{ vars.AWS_ACCOUNT_ID }}.dkr.ecr.${{ vars.AWS_REGION }}.amazonaws.com/hypermode/runtime:latest
runtime-build-workflow-dispatch:
if: ${{ github.event_name == 'workflow_dispatch' }}
environment: "${{ github.event.inputs.environment }}"
Expand All @@ -81,8 +35,9 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
go-version: 1.23
check-latest: true
cache-dependency-path: runtime/go.sum
- name: Set Runtime Release Version
run: |
#!/bin/bash
Expand Down Expand Up @@ -115,7 +70,7 @@ jobs:
- name: Build and push runtime docker image
uses: docker/build-push-action@v6
with:
context: .
context: "{{defaultContext}}:runtime"
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/ci-go-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will lint all Go projects in the repository
name: ci-go-lint
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
get-dirs:
if: github.event_name == 'pull_request'
name: find go projects
runs-on: ubuntu-latest
outputs:
dirs: ${{ steps.get-dirs.outputs.dirs }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Search for go.mod files
id: get-dirs
run: echo "dirs=$(find . -name 'go.mod' -exec dirname {} \; | jq -Rsc 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT}

go-lint:
needs: get-dirs
if: github.event_name == 'pull_request'
name: lint
runs-on: ubuntu-latest
strategy:
matrix:
dir: ${{ fromJson(needs.get-dirs.outputs.dirs) }}
defaults:
run:
working-directory: ${{ matrix.dir }}
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
cache-dependency-path: "${{ matrix.dir }}/go.sum"
go-version-file: "${{ matrix.dir }}/go.mod"
- name: Generate Code
run: go generate ./...
- name: Run Linter
uses: golangci/golangci-lint-action@v6
with:
working-directory: ${{ matrix.dir }}
version: latest
args: --timeout=10m
51 changes: 51 additions & 0 deletions .github/workflows/ci-go-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This workflow will test all Go projects in the repository
name: ci-go-test
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
get-dirs:
if: github.event_name == 'pull_request'
name: find go projects
runs-on: ubuntu-latest
outputs:
dirs: ${{ steps.get-dirs.outputs.dirs }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Search for go.mod files
id: get-dirs
run: echo "dirs=$(find . -name 'go.mod' -exec dirname {} \; | jq -Rsc 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT}

go-test:
needs: get-dirs
name: test
runs-on: warp-ubuntu-latest-x64-4x
strategy:
matrix:
dir: ${{ fromJson(needs.get-dirs.outputs.dirs) }}
defaults:
run:
working-directory: ${{ matrix.dir }}
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
cache-dependency-path: "${{ matrix.dir }}/go.sum"
go-version-file: "${{ matrix.dir }}/go.mod"
- name: Generate Code
run: go generate ./...
- name: Run Unit Tests
run: |
go install github.com/jstemmer/go-junit-report/v2@latest
go test -v -race 2>&1 ./... | go-junit-report -set-exit-code -iocopy -out report.xml
- name: Generate Test Summary
if: always()
uses: test-summary/action@v2
with:
paths: "${{ matrix.dir }}/report.xml"
27 changes: 0 additions & 27 deletions .github/workflows/ci-golang-lint.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/ci-golang-unit-tests.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci-golang-integration-tests
name: ci-runtime-integration-tests
on:
pull_request:
types:
Expand All @@ -7,7 +7,7 @@ on:
- reopened
- ready_for_review
jobs:
golang-tests:
runtime-integration-tests:
name: test
runs-on: warp-ubuntu-latest-x64-4x
if: github.event.pull_request.draft == false
Expand All @@ -16,16 +16,13 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
check-latest: true
- name: Generate Code
run: go generate ./...
go-version: 1.23
cache-dependency-path: runtime/go.sum
- name: Run Integration Tests
run: |
go install github.com/jstemmer/go-junit-report/v2@latest
go test -tags integration -v -race 2>&1 ./integration_tests/... | go-junit-report -set-exit-code -iocopy -out report.xml
working-directory: runtime
run: make test-integration-ci
- name: Generate Test Summary
if: always()
uses: test-summary/action@v2
with:
paths: "report.xml"
paths: "runtime/report.xml"
Loading

0 comments on commit 21d94a4

Please sign in to comment.