-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from subquery/CI
Setup PR action
- Loading branch information
Showing
42 changed files
with
2,023 additions
and
1,635 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: PR | ||
on: | ||
pull_request: | ||
paths-ignore: | ||
- ".github/workflows/**" | ||
|
||
jobs: | ||
test: | ||
name: test | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
id-token: write # Needed for auth with Deno Deploy | ||
contents: read # Needed to clone the repository | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: 2.0.0-rc.10 | ||
|
||
- name: Run tests | ||
run: deno task test | ||
|
||
code-style: | ||
name: code-style | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: 2.0.0-rc.10 | ||
|
||
- name: Lint | ||
run: deno lint | ||
|
||
typescript: | ||
name: typescript | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: 2.0.0-rc.10 | ||
|
||
- name: Check typescript | ||
run: deno task check-ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Docker Publish | ||
on: | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
inputs: | ||
isLatest: | ||
description: "Add latest tag" | ||
default: "true" | ||
required: true | ||
|
||
jobs: | ||
publish-docker: | ||
name: test | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
id-token: write # Needed for auth with Deno Deploy | ||
contents: read # Needed to clone the repository | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: subquerynetwork | ||
password: ${{ secrets.SQ_DOCKERHUB_TOKEN }} | ||
|
||
# Read the version from deno.json | ||
- name: Extract version | ||
id: extract_version | ||
run: | | ||
version=$(cat deno.json | jq -r '.version') | ||
echo "AI_APP_VERSION=$version" >> $GITHUB_ENV | ||
- name: Build and push | ||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'false' | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
platforms: arm64,amd64 | ||
file: ./Dockerfile | ||
tags: subquerynetwork/subql-ai-app | ||
build-args: RELEASE_VERSION=${{ env.AI_APP_VERSION }} | ||
|
||
- name: Build and push | ||
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'true') | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
platforms: arm64,amd64 | ||
file: ./Dockerfile | ||
tags: subquerynetwork/subql-ai-app:v${{ env.AI_APP_VERSION }},subquerynetwork/subql-ai-app:latest | ||
build-args: RELEASE_VERSION=${{ env.AI_APP_VERSION }} | ||
|
||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/hook.sh" | ||
deno run -A npm:lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"*.ts": [ | ||
"deno lint --fix", | ||
"deno fmt" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM denoland/deno:2.0.0-rc.10 | ||
|
||
WORKDIR /ai-app | ||
|
||
# Prefer not to run as root. | ||
USER deno | ||
|
||
COPY . . | ||
RUN deno cache ./src/index.ts | ||
|
||
ENTRYPOINT ["./src/index.ts"] | ||
|
||
CMD ["-p","/app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
{ | ||
"name": "@subql/ai-app-framework", | ||
"version": "1.0.0-0", | ||
"exports": "./src/index.ts", | ||
"tasks": { | ||
"dev": "deno run --watch src/index.ts", | ||
"test": "deno test --allow-env --allow-net --allow-read --allow-run --allow-write --unstable-worker-options" | ||
"check-ts": "deno check src/index.ts", | ||
"test": "deno test --allow-env --allow-net --allow-read --allow-run --allow-write --unstable-worker-options", | ||
"hook": "deno run --allow-read --allow-run --allow-write https://deno.land/x/[email protected]/mod.ts" | ||
}, | ||
"imports": { | ||
"@lancedb/lancedb": "npm:@lancedb/lancedb@^0.10.0", | ||
|
@@ -16,6 +21,8 @@ | |
"@std/io": "jsr:@std/io@^0.224.8", | ||
"@std/path": "jsr:@std/path@^1.0.6", | ||
"@std/tar": "jsr:@std/tar@^0.1.1", | ||
"@types/estree": "npm:@types/estree@^1.0.5", | ||
"@types/mdast": "npm:@types/mdast@^4.0.4", | ||
"@types/yargs": "npm:@types/yargs@^17.0.33", | ||
"apache-arrow": "npm:apache-arrow@^17.0.0", | ||
"esbuild": "npm:esbuild@^0.24.0", | ||
|
Oops, something went wrong.