Deploy and Set up quiz in one task #61
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-test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test-backend-hardhatnode-frontend: | |
name: test-backend-hardhatnode-frontend | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
working-directory: backend | |
run: pnpm install | |
- name: Build backend | |
working-directory: backend | |
run: pnpm build | |
- name: Test backend | |
working-directory: backend | |
run: pnpm test | |
- name: Build frontend | |
working-directory: frontend | |
run: pnpm build | |
test-backend-sapphire: | |
name: test-backend-sapphire | |
runs-on: ubuntu-latest | |
services: | |
sapphire-localnet-ci: | |
image: ghcr.io/oasisprotocol/sapphire-localnet:latest | |
ports: | |
- 8545:8545 | |
- 8546:8546 | |
env: | |
OASIS_DEPOSIT: /oasis-deposit -test-mnemonic -n 5 | |
options: >- | |
--rm | |
--health-cmd="/oasis-node debug control wait-ready -a unix:/serverdir/node/net-runner/network/client-0/internal.sock" | |
--health-start-period=90s | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
working-directory: backend | |
run: pnpm install | |
- name: Build backend | |
working-directory: backend | |
run: pnpm build | |
- name: Test backend | |
working-directory: backend | |
run: pnpm test -- --network sapphire-localnet |