Skip to content

Merge pull request #620 from desci-labs/authToken/script #1394

Merge pull request #620 from desci-labs/authToken/script

Merge pull request #620 from desci-labs/authToken/script #1394

# build.yml
on:
# pull_request:
# paths:
# - desci-server/**
push:
paths:
- .github/workflows/**
- desci-server/**
- desci-repo/**
- desci-contracts/**
- Dockerfile
name: Test desci-server
# https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html
env:
AWS_DEFAULT_REGION: us-east-2
AWS_DEFAULT_OUTPUT: json
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CONTAINER_IMAGE: desci-server
DOCKER_BUILDKIT: 1
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
jobs:
build-and-test:
runs-on: ubuntu-22.04
# container:
# image: ubuntu:latest
# options: --user 1001
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up the environment
# Replace this line with the appropriate setup for your project
# Examples:
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
check-latest: false
cache: "yarn"
cache-dependency-path: |
desci-models/yarn.lock
desci-server/yarn.lock
desci-repo/yarn.lock
- name: Install dependencies
run: cd desci-models && npm i -g yarn && yarn && yarn build && cd ../desci-server && yarn --ignore-engines && cd ../desci-repo && yarn
- name: Stub contract
run: |
echo "{\"proxies\":[{\"address\":\"\"}]}" > desci-server/src/desci-contracts-config/unknown-research-object.json
echo "{\"proxies\":[{\"address\":\"\"}]}" > desci-server/src/desci-contracts-config/unknown-dpid.json
- name: Set up Sentry CLI
run: |
npm install -g @sentry/cli
sentry-cli --version
sentry-cli login --auth-token $SENTRY_AUTH_TOKEN
# append to .env
echo -e "\nSENTRY_AUTH_TOKEN=$SENTRY_AUTH" >> desci-server/.env
cd desci-server && yarn build
- name: Run tests
run: |
cd desci-server && export DOCKER_BUILDKIT=1 && yarn --ignore-engines && yarn test
if [ $? -ne 0 ]; then
exit 1
fi