Skip to content

Commit

Permalink
ci: add terra (#965)
Browse files Browse the repository at this point in the history
* chore: optimize

* build: not throw on ci ubuntu

* build: not throw on ci ubuntu

* build: not throw on ci ubuntu

* build: optimize

* build: optimize

* build: optimize

* build: optimize
  • Loading branch information
LichKing-2234 authored Apr 3, 2023
1 parent bed9adb commit 0d53c3c
Show file tree
Hide file tree
Showing 11 changed files with 768 additions and 338 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
24 changes: 24 additions & 0 deletions .github/actions/doc/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: doc
description: Generate comments
inputs:
target-path:
description: The path to generate comments, if set, will skip clone & pr
default: ""
github-token:
description: The github token
required: true

runs:
using: composite
steps:
- name: Generate comments
uses: AgoraIO-Extensions/actions/.github/actions/doc@main
with:
target-repo: ${{ github.repository }}
target-branch: ${{ github.ref_name }}
target-path: ${{ inputs.target-path }}
config: fmt_config/fmt_ts.yaml
language: ts
base-template-url: https://github.com/AgoraIO/agora_doc_source/releases/download/main/electron_ng_json_template_en.json
export-file-path: ts/AgoraSdk.ts
github-token: ${{ inputs.github-token }}
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Lint files
run: yarn lint

- name: Typecheck files
run: |
set +e
yarn install --cwd example --frozen-lockfile
set -e
yarn typecheck
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn prepack
16 changes: 7 additions & 9 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
name: Update doc
name: Generate comments
run-name: ${{ github.actor }} triggered this job
on:
workflow_dispatch:

jobs:
update-doc:
generate-comments:
runs-on: ubuntu-latest
steps:
- uses: AgoraIO-Extensions/actions/.github/actions/doc@main
- name: Checkout
uses: actions/checkout@v3

- name: Generate comments
uses: ./.github/actions/doc
with:
target_repo: ${{ github.repository }}
target_branch: ${{ github.ref_name }}
config: fmt_config/fmt_ts.yaml
language: ts
base-template-url: https://github.com/AgoraIO/agora_doc_source/releases/download/main/electron_ng_json_template_en.json
export-file-path: ts/AgoraSdk.ts
github-token: ${{ secrets.GH_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/terra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Generate codes
run-name: ${{ github.actor }} triggered this job
on:
workflow_dispatch:

jobs:
generate-codes:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Generate codes
uses: AgoraIO-Extensions/actions/.github/actions/terra@main
env:
LLVM_DOWNLOAD_URL: |
https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
with:
target-path: ${{ github.workspace }}
config: ci/config/terra_config.yaml
output-dir: src
github-token: ${{ secrets.GH_TOKEN }}

- name: Format codes
run: |
rm -rf terra
yarn lint --fix
- name: Generate ts interface
run: |
yarn ts_interface_builder
- name: Generate comments
uses: ./.github/actions/doc
with:
target-path: ${{ github.workspace }}
github-token: ${{ secrets.GH_TOKEN }}

- name: Clean
run: |
rm -rf
- name: Create pull request
uses: AgoraIO-Extensions/actions/.github/actions/pr@main
with:
target-repo: ${{ github.workspace }}
target-branch: ${{ github.ref_name }}
target-branch-name-surffix: |
terra-update
pull-request-title: |
[AUTO] Generate code by terra
add-paths: src
github-token: ${{ secrets.GH_TOKEN }}
7 changes: 7 additions & 0 deletions ci/config/terra_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include: shared:rtc_4.1.0/shared_configs.yaml

language: ts

legacy_renders:
- TsInterfaceRender
- TsImplRender
Loading

0 comments on commit 0d53c3c

Please sign in to comment.