-
Notifications
You must be signed in to change notification settings - Fork 1
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 #74 from credbull/fix-github-actions
Fix the broken GitHub Actions for `ops` and `sdk`.
- Loading branch information
Showing
7 changed files
with
105 additions
and
105 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
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 |
---|---|---|
|
@@ -19,10 +19,10 @@ on: | |
jobs: | ||
ops-int-test: | ||
runs-on: ubuntu-latest | ||
environment: ci | ||
environment: local | ||
|
||
steps: | ||
- name: Checkout | ||
- name: Checkout credbull-defi | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install yarn | ||
|
@@ -44,17 +44,45 @@ jobs: | |
- name: Install Project Dependencies | ||
run: yarn install | ||
|
||
- name: Run Ops tests | ||
- name: Setup Local Environment | ||
run: find . -type f -name ".env*.sample" -exec sh -c 'F={}; cp -nv $F $(dirname $F)/$(basename $F .sample)' \; | ||
|
||
- name: Build Project | ||
run: yarn build | ||
|
||
- name: Setup Supabase CLI | ||
uses: supabase/[email protected] | ||
with: | ||
version: latest | ||
|
||
- name: Start Supabase | ||
run: supabase start | ||
working-directory: packages/api | ||
|
||
- name: Run Docker Compose with Background Services | ||
run: docker compose --env-file packages/api/.env up --detach --build --wait | ||
|
||
- name: Deploy Credbull Contracts | ||
run: yarn deploy | ||
working-directory: packages/contracts | ||
|
||
- name: Create Default Users | ||
run: yarn op --create-default-users | ||
working-directory: packages/ops | ||
|
||
- name: Run Ops Integration Tests | ||
run: yarn int-test | ||
working-directory: packages/ops | ||
env: | ||
ENVIRONMENT: ${{ vars.ENVIRONMENT }} | ||
DEPLOYER_PRIVATE_KEY: ${{ secrets.DEVOPS_SEPOLIA_DEPLOYER_PRIVATE_KEY }} | ||
ADMIN_PRIVATE_KEY: ${{ secrets.DEVOPS_SEPOLIA_ADMIN_PRIVATE_KEY }} | ||
ALICE_PRIVATE_KEY: ${{ secrets.DEVOPS_SEPOLIA_ALICE_PRIVATE_KEY }} | ||
BOB_PRIVATE_KEY: ${{ secrets.DEVOPS_SEPOLIA_BOB_PRIVATE_KEY }} | ||
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} | ||
ADMIN_PASSWORD: NeverGuessThis | ||
ALICE_PASSWORD: alice-1234 | ||
BOB_PASSWORD: bobword | ||
|
||
- name: See API Logs, If Tests Failed | ||
run: docker logs api | ||
if: ${{ failure() }} | ||
|
||
- name: Shutdown Docker Compose detached | ||
run: docker compose --env-file packages/api/.env down | ||
if: ${{ always() }} | ||
|
||
- name: Stop Supabase | ||
run: supabase stop --no-backup | ||
working-directory: packages/api | ||
if: ${{ always() }} |
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 |
---|---|---|
|
@@ -10,18 +10,17 @@ on: | |
branches: | ||
- "main*" | ||
- "development*" | ||
- "ops*" | ||
paths: | ||
- "packages/sdk/**" | ||
- ".github/workflows/ci-dev-sdk.yml" | ||
|
||
jobs: | ||
sdk-int-test: | ||
runs-on: ubuntu-latest | ||
environment: testnet | ||
environment: local | ||
|
||
steps: | ||
- name: Checkout | ||
- name: Checkout credbull-defi | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install yarn | ||
|
@@ -43,26 +42,12 @@ jobs: | |
- 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: Build Project | ||
run: yarn build | ||
|
||
# TODO: using local supabase for SDK. | ||
# if we want a deployed instance, we need to set up a new one for the SDK. | ||
- name: Setup Supabase CLI | ||
uses: supabase/[email protected] | ||
with: | ||
|
@@ -72,6 +57,9 @@ jobs: | |
run: supabase start | ||
working-directory: packages/api | ||
|
||
- name: Run Docker Compose with Background Services | ||
run: docker compose --env-file packages/api/.env up --detach --build --wait | ||
|
||
- name: Deploy Credbull Contracts | ||
run: yarn deploy | ||
working-directory: packages/contracts | ||
|
@@ -80,19 +68,19 @@ jobs: | |
run: yarn op --create-default-users | ||
working-directory: packages/ops | ||
|
||
- name: Logs | ||
run: docker logs api --tail all | ||
|
||
- name: Run SDK tests | ||
run: | | ||
set -a | ||
source ../api/.env | ||
source .env | ||
set +a | ||
yarn int-test | ||
- name: Run SDK Integration Tests | ||
run: yarn int-test | ||
working-directory: packages/sdk | ||
|
||
- name: Clean vault data | ||
run: yarn op --clean-vault-table | ||
working-directory: packages/ops | ||
- name: See API Logs, If Tests Failed | ||
run: docker logs api | ||
if: ${{ failure() }} | ||
|
||
- name: Shutdown Docker Compose detached | ||
run: docker compose --env-file packages/api/.env down | ||
if: ${{ always() }} | ||
|
||
- name: Stop Supabase | ||
run: supabase stop --no-backup | ||
working-directory: packages/api | ||
if: ${{ always() }} |
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