Skip to content

Commit

Permalink
Adding ops package github action
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasia committed Jun 14, 2024
1 parent e987a8f commit 83557d5
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 4 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/ci-dev-ops.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: ci-dev-ops

defaults:
run:
working-directory: .

on:
workflow_dispatch:
push:
branches:
- "main*"
- "development*"
- "ops*"
paths:
- "packages/sdk/**"
- ".github/workflows/ci-dev-sdk.yml"

jobs:
deploy:
runs-on: ubuntu-latest
environment: testnet

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install yarn
run: |
corepack prepare yarn@stable --activate
npm install -g yarn
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"

- name: Install foundry-toolchain
uses: foundry-rs/[email protected]
with:
version: nightly

- name: Install Project Dependencies
run: yarn install

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Setup Local Environment
run: find . -type f -name ".env*.sample" -exec sh -c 'F={}; cp -nv $F $(dirname $F)/$(basename $F .sample)' \;
working-directory: .

# Docker compose detached (-d) so other jobs can continue
# Env variables are sourced and then exported (set -a)
- name: Run Docker compose detached
run: |
set -a
source packages/api/.env
set +a
docker-compose up -d --build
- name: Setup Supabase CLI
uses: supabase/[email protected]
with:
version: latest

- name: Start Supabase
run: supabase start
working-directory: packages/api

- name: Deploy Credbull Contracts
run: yarn deploy
working-directory: packages/contracts

- name: Logs
run: docker logs api --tail all

- name: Run Ops tests
run: |
set -a
source ../api/.env
source .env
set +a
yarn int-test
working-directory: packages/ops

- name: Clean vault data
run: yarn op --clean-vault-table
working-directory: packages/ops

- name: Cleanup Yarn Cache
if: always()
run: yarn cache clean
8 changes: 5 additions & 3 deletions .github/workflows/ci-dev-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install yarn
run: |
corepack prepare yarn@stable --activate
npm install -g yarn
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"

- name: Install yarn
run: corepack prepare yarn@stable --activate

- name: Install foundry-toolchain
uses: foundry-rs/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion packages/ops/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default defineConfig({
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
reporter: [['list'], ['html', { outputFolder: 'playwright-report', open: 'never' }]],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
Expand Down

0 comments on commit 83557d5

Please sign in to comment.