Skip to content

Commit

Permalink
split test actions
Browse files Browse the repository at this point in the history
  • Loading branch information
roodboi committed Mar 5, 2024
1 parent 9567393 commit d45d3ac
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 47 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

name: Test PR
on:
pull_request_target:
branches:
- main
jobs:
approve:
runs-on: ubuntu-latest

steps:
- name: Approve
run: echo For security reasons, all pull requests need to be approved first before running any automated CI.

test-branch:
if: github.ref != 'refs/heads/main'
name: run-tests
runs-on: ubuntu-latest
needs: [approve]
environment: OPENAI
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANYSCALE_API_KEY: ${{ secrets.ANYSCALE_API_KEY }}
TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2

- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

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

- name: Install Dependencies
run: bun i

- run: bun run type-check
- run: bun run lint
- run: bun test --timeout=25000

48 changes: 1 addition & 47 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Test
name: Test Main
on:
pull_request_target:
branches:
- main
push:
branches:
- main
Expand Down Expand Up @@ -38,46 +35,3 @@ jobs:
- run: bun run type-check
- run: bun run lint
- run: bun test --timeout=25000

approve:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest

steps:
- name: Approve
run: echo For security reasons, all pull requests need to be approved first before running any automated CI.

test-branch:
if: github.ref != 'refs/heads/main'
name: run-tests
runs-on: ubuntu-latest
needs: [approve]
environment: OPENAI
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANYSCALE_API_KEY: ${{ secrets.ANYSCALE_API_KEY }}
TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2

- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

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

- name: Install Dependencies
run: bun i

- run: bun run type-check
- run: bun run lint
- run: bun test --timeout=25000

0 comments on commit d45d3ac

Please sign in to comment.