ci-dev-sdk #152
Workflow file for this run
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
name: ci-dev-sdk | |
defaults: | |
run: | |
working-directory: . | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "*" ] | |
paths: | |
- "packages/sdk/**" | |
- ".github/workflows/ci-dev-sdk.yml" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: testnet | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install yarn | |
run: npm install -g yarn | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "yarn" | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install dependencies | |
run: yarn install | |
- name: Install Docker Compose | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y docker-compose | |
# Docker compose detached (-d) so other jobs can continue | |
# Env variables are sourced and then exported (set -a) | |
- name: Run Docker compose detached | |
run: | | |
cp -n packages/api/.env.sample packages/api/.env | |
set -a | |
source packages/api/.env | |
set +a | |
docker-compose up -d --build | |
# TODO: using local supabase for SDK. | |
# if we want a deployed instance, we need to set up a new one for the SDK. | |
- uses: supabase/setup-cli@v1 | |
with: | |
version: latest | |
- run: supabase start | |
working-directory: packages/api/supabase | |
- name: Deploy contracts | |
run: cp -n .env.sample .env && yarn deploy | |
working-directory: packages/contracts | |
# TODO: this keeps failing - move this step out? | |
- name: Create Default Users | |
run: cp -n ../../.env.sample ../../.env && cp -n .env.sample .env && yarn op --create-default-users | |
working-directory: scripts/operation | |
- name: Logs | |
run: docker logs api --tail all | |
- name: Run SDK tests | |
run: | | |
cp -n ../api/.env.sample ../api/.env | |
cp -n .env.sample .env | |
set -a | |
source ../api/.env | |
source .env | |
set +a | |
yarn int-test | |
env: | |
SOME_ENV: "some_env" | |
working-directory: packages/sdk | |
- name: Clean vault data | |
run: cp -n .env.sample .env && yarn op --clean-vault-table | |
working-directory: scripts/operation | |
- name: Cleanup | |
if: always() | |
run: npm uninstall -g yarn |