Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create main.yml #360

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Code Review GPT

on:
pull_request:
branches: [main]

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

- name: Code Review GPT
uses: BFRS01757/code-review-gpt@main
with:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MODEL: 'gpt-4o-mini'
GITHUB_TOKEN: ${{ github.token }}
54 changes: 0 additions & 54 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1 @@
on:
push:
branches:
- main

name: 🚀 Deploy to staging
concurrency: deploy_staging

permissions:
id-token: write # this is required for AWS https://github.com/aws-actions/configure-aws-credentials#usage
contents: read # this is required for Nx https://github.com/nrwl/nx-set-shas#permissions-in-v2
actions: read # this is required for Nx https://github.com/nrwl/nx-set-shas#permissions-in-v2

env:
CI: true
AWS_REGION: eu-west-2

defaults:
run:
shell: bash

jobs:
build_and_test_core:
runs-on: ubuntu-latest
env:
CI: true
AWS_REGION: eu-west-2

defaults:
run:
working-directory: services/core
shell: bash

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN_STAGING }}

- name: Install pnpm
run: npm i -g pnpm

- name: 🚀 Deploy core
run: npm i && npm run deploy-staging
84 changes: 0 additions & 84 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1 @@
name: Code Review GPT CI

on:
pull_request:
branches: [main]

permissions:
id-token: write
pull-requests: write
contents: read
actions: read

jobs:
build_and_test_crgpt_package:
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/code-review-gpt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
GITHUB_SHA: ${{ github.sha }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Run code review script
run: npm run start -- --ci=github --model=gpt-4o

- name: Run linting test
run: npm run lint-test

- name: Run unit tests
run: npm run test-unit

- name: Run prompt tests
run: npm run test -- --ci=github --model=gpt-4o

deploy_core_to_dev:
runs-on: ubuntu-latest
env:
CI: true
AWS_REGION: eu-west-2
APP_ID: ${{ secrets.APP_ID }}
WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}

defaults:
run:
working-directory: services/core
shell: bash

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN_DEV }}

- name: Install pnpm
run: npm i -g pnpm

- name: 🚀 Deploy core to dev
run: pnpm i && pnpm deploy-dev
46 changes: 0 additions & 46 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1 @@
name: Release Package

defaults:
run:
shell: bash
working-directory: packages/code-review-gpt

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release-please.outputs.releases_created }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release-please
with:
release-type: node
package-name: code-review-gpt
path: code-review-gpt
publish-package:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.releases_created }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
registry-url: "https://registry.npmjs.org"
- name: 💫 Install dependencies
run: npm ci
- name: 🏡 Build
run: npm run build
- name: 🚀 Publish code-review-gpt
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}