From 08c34762e97af524259199c58d2b66d31ceb0455 Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Sat, 7 Sep 2024 17:07:39 +0000 Subject: [PATCH] test: run service tests only when api/packages change --- .github/workflows/test-services.yml | 33 +++++++++++++++++++++++++++++ .github/workflows/test.yml | 26 +---------------------- 2 files changed, 34 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/test-services.yml diff --git a/.github/workflows/test-services.yml b/.github/workflows/test-services.yml new file mode 100644 index 00000000..6291c736 --- /dev/null +++ b/.github/workflows/test-services.yml @@ -0,0 +1,33 @@ +name: Run service tests + +on: + pull_request: + push: + paths: + - api/** + - packages/** + +jobs: + check-services: + name: test service functionality + runs-on: ubuntu-latest + outputs: + services: ${{ steps.checkServices.outputs.service_list }} + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - id: checkServices + run: pnpm i --frozen-lockfile && echo "service_list=$(node api/src/util/test-ci get-services)" >> "$GITHUB_OUTPUT" + + test-services: + needs: check-services + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + service: ${{ fromJson(needs.check-services.outputs.services) }} + name: "test service: ${{ matrix.service }}" + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - run: pnpm i --frozen-lockfile && node api/src/util/test-ci run-tests-for ${{ matrix.service }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e49e342c..28439369 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,28 +31,4 @@ jobs: steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - - run: .github/test.sh api - - check-services: - name: test service functionality - runs-on: ubuntu-latest - outputs: - services: ${{ steps.checkServices.outputs.service_list }} - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - id: checkServices - run: pnpm i --frozen-lockfile && echo "service_list=$(node api/src/util/test-ci get-services)" >> "$GITHUB_OUTPUT" - - test-services: - needs: check-services - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - service: ${{ fromJson(needs.check-services.outputs.services) }} - name: "test service: ${{ matrix.service }}" - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - run: pnpm i --frozen-lockfile && node api/src/util/test-ci run-tests-for ${{ matrix.service }} \ No newline at end of file + - run: .github/test.sh api \ No newline at end of file