P-1111 Adding integration-tests in DA #87
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: General CI | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
paths-ignore: | ||
- '**/README.md' | ||
pull_request: | ||
branches: | ||
- dev | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
jobs: | ||
set-env: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set Node version | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
fmt: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- set-env | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Fmt check | ||
run: | | ||
corepack enable && corepack enable pnpm && pnpm install --frozen-lockfile | ||
pnpm run check-format | ||
contracts-uint-tests: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- set-env | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install deps | ||
run: | | ||
npm install --save-dev hardhat | ||
- name: Run contracts unit tests | ||
run: | | ||
npx hardhat test | ||
- name: Run contracts unit tests | ||
run: | | ||
npx hardhat test | ||
integration-tests: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- contracts-uint-tests | ||
env: | ||
TWITTER_AUTH_TOKEN_V2: ${{ secrets.TWITTER_AUTH_TOKEN_V2 }} | ||
DISCORD_AUTH_TOKEN: ${{ secrets.DISCORD_AUTH_TOKEN }} | ||
ACHAINABLE_AUTH_KEY: ${{ secrets.ACHAINABLE_AUTH_KEY }} | ||
ONEBLOCK_NOTION_KEY: ${{ secrets.ONEBLOCK_NOTION_KEY }} | ||
NODEREAL_API_KEY: ${{ secrets.NODEREAL_API_KEY }} | ||
GENIIDATA_API_KEY: ${{ secrets.GENIIDATA_API_KEY }} | ||
MORALIS_API_KEY: ${{ secrets.MORALIS_API_KEY }} | ||
MAGIC_CRAFT_API_KEY: ${{ secrets.MAGIC_CRAFT_API_KEY }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Pull litentry image optionally | ||
run: | | ||
docker pull litentry/identity-worker:latest | ||
docker pull litentry/identity-cli:latest | ||
docker pull litentry/litentry-chain-aio:latest | ||
- name: Create env file with secrets | ||
run: | | ||
mkdir -p /opt/worker_configs | ||
for key in TWITTER_AUTH_TOKEN_V2 DISCORD_AUTH_TOKEN ACHAINABLE_AUTH_KEY ONEBLOCK_NOTION_KEY NODEREAL_API_KEY GENIIDATA_API_KEY MORALIS_API_KEY MAGIC_CRAFT_API_KEY; do | ||
echo "$key=${{ secrets[$key] }}" >> /opt/worker_configs/worker_env | ||
done | ||
- name: Start parachain-worker | ||
shell: bash | ||
run: | | ||
./scripts/run_parachain_worker.sh | ||
docker ps | ||
- name: Compile contracts | ||
run: | | ||
npm install --save-dev hardhat | ||
npx hardhat compile | ||
- name: Run integration tests | ||
working-directory: ./vc-di-tests/integration-tests | ||
run: | | ||
corepack enable && corepack enable pnpm && pnpm install --no-frozen-lockfile | ||
pnpm run test assertion_contracts.test.ts | ||
- name: Stop docker | ||
run: | | ||
docker rm -f $(docker ps -aq) | ||
- name: Upload docker logs if test fails | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: integration-tests-docker-logs | ||
path: docker-logs | ||
if-no-files-found: ignore | ||
retention-days: 3 |