From 7ac49ab65cab2a28706293a8f04edcc7684170d3 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Wed, 14 Aug 2024 14:45:16 -0700 Subject: [PATCH] chore(list): adding in list api --- .github/workflows/list_api.yml | 16 +++++++ .github/workflows/test_integrations.yml | 55 +++++++++++++++++++++++++ .github/workflows/user_api.yml | 29 ++----------- 3 files changed, 74 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/list_api.yml create mode 100644 .github/workflows/test_integrations.yml diff --git a/.github/workflows/list_api.yml b/.github/workflows/list_api.yml new file mode 100644 index 000000000..b6203b9d4 --- /dev/null +++ b/.github/workflows/list_api.yml @@ -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' \ No newline at end of file diff --git a/.github/workflows/test_integrations.yml b/.github/workflows/test_integrations.yml new file mode 100644 index 000000000..94d36954c --- /dev/null +++ b/.github/workflows/test_integrations.yml @@ -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'] }} \ No newline at end of file diff --git a/.github/workflows/user_api.yml b/.github/workflows/user_api.yml index cfefee670..cdca3c81c 100644 --- a/.github/workflows/user_api.yml +++ b/.github/workflows/user_api.yml @@ -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... \ No newline at end of file + uses: ./.github/workflows/test_integrations.yml + with: + scope: 'user-api' \ No newline at end of file