chore: Add e2e spec #3
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 | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
types: [opened, synchronize] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
install: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restore node_modules cache | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
- name: Install dependencies | |
if: steps.node-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
lint: | |
runs-on: ubuntu-latest | |
needs: [install] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restore node_modules cache | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
- name: Install dependencies | |
if: steps.node-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Run linter | |
run: npm run lint | |
compile-types: | |
runs-on: ubuntu-latest | |
needs: [install] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restore node_modules cache | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
- name: Install dependencies | |
if: steps.node-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: lint | |
run: npm run type-check | |
build: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
needs: [lint, compile-types] | |
outputs: | |
build_id: ${{ steps.build_id.outputs.BUILD_ID }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restore node_modules cache | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
- name: Install dependencies | |
if: steps.node-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Build | |
run: | | |
npm run build | |
docker buildx build -t api:local -f Dockerfile . | |
e2e-tests: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
env: | |
ARC_CLOUD_TOKEN: ${{ secrets.ARC_CLOUD_TOKEN }} | |
SECRET_KEY: secret | |
needs: [lint, compile-types] | |
outputs: | |
build_id: ${{ steps.build_id.outputs.BUILD_ID }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restore node_modules cache | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
- name: Install dependencies | |
if: steps.node-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Build | |
run: npm run test:e2e |