Skip to content

Commit

Permalink
chore(list): adding in list api
Browse files Browse the repository at this point in the history
  • Loading branch information
bassrock committed Aug 14, 2024
1 parent cbf54ec commit 9a4ca8a
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 26 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/list_api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: List API
on:
pull_request:
paths:
- 'infrastructure/list-api/**'
- 'packages/**'
- 'servers/list-api/**'
- 'pnpm-lock.yaml'
- '.github/actions/**'
- '.github/workflows/list_api.yml'

jobs:
test-integrations:
uses: ./.github/workflows/test_integrations.yml
with:
scope: 'list-api'
# Ensure the re-usable workflow is allowed to access the secrets
secrets: inherit
37 changes: 37 additions & 0 deletions .github/workflows/test_integrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'Re-usable Test Integrations'
on:
workflow_call:
inputs:
scope:
description: 'Turbo Repo scope to run tests for'
required: true
type: string

jobs:
test-integrations:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Kick off starting docker compose first, since it can take a bit
- name: Start Docker Compose services
run: docker compose up -d

# While we wait for docker compose to be healthy we install node and needed packages.
- name: Install pnpm & node
uses: ./.github/actions/install-pnpm-and-node
with:
scope: ${{ inputs['scope'] }}

# Step 4: Wait for the services to be healthy
- name: Wait for services to be healthy
run: docker compose up --wait
- name: Run service integration tests
run: pnpm run test-integrations --filter=${{ inputs['scope'] }}
31 changes: 5 additions & 26 deletions .github/workflows/user_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,8 @@ on:

jobs:
test-integrations:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Kick off starting docker compose first, since it can take a bit
- name: Start Docker Compose services
run: docker compose up -d

# While we wait for docker compose to be healthy we install node and needed packages.
- name: Install pnpm & node
uses: ./.github/actions/install-pnpm-and-node
with:
scope: user-api

# Step 4: Wait for the services to be healthy
- name: Wait for services to be healthy
run: docker compose up --wait
- name: Run service integration tests
run: pnpm run test-integrations --filter=user-api...
uses: ./.github/workflows/test_integrations.yml
with:
scope: 'user-api'
# Ensure the re-usable workflow is allowed to access the secrets
secrets: inherit

0 comments on commit 9a4ca8a

Please sign in to comment.