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 7ac49ab
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 26 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/list_api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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'
55 changes: 55 additions & 0 deletions .github/workflows/test_integrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# .github/workflows/reusable-install.yml
name: 'Test Integrations'
on:
workflow_call:
inputs:
scope:
description: 'Turbo Repo scope to run tests for'
required: true
type: string

jobs:
install:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version:

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install

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'] }}
29 changes: 3 additions & 26 deletions .github/workflows/user_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,6 @@ 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'

0 comments on commit 7ac49ab

Please sign in to comment.