mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57:22 +00:00
ci: add integration test
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
name: Package Test
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
package:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
integration-test:
|
||||
name: Integration Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- run: yarn install --immutable
|
||||
- name: Turbo Cache
|
||||
id: turbo-cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: .turbo
|
||||
key: ${{ runner.os }}-turbo-test:integration-${{ inputs.package }}-${{ github.sha }}
|
||||
- name: Build dist cache
|
||||
if: steps.turbo-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: .turbo
|
||||
key: ${{ runner.os }}-turbo-build-${{ github.sha }}
|
||||
- name: Integration Test
|
||||
run: yarn test:integration --cache-dir=".turbo" --filter=./packages/${{ inputs.package }}
|
||||
- name: Collect and upload the coverage report
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: ./packages/${{ inputs.package }}/coverage/lcov.info
|
||||
flags: ${{ inputs.package }}-integration
|
||||
+32
-26
@@ -128,51 +128,57 @@ jobs:
|
||||
run: yarn test:test-type --cache-dir=".turbo"
|
||||
|
||||
# Not using matrix because test later on cant needs a specific job
|
||||
client-unit-and-integration-test:
|
||||
client-unit-test:
|
||||
name: Client
|
||||
needs: build-dist
|
||||
uses: ./.github/workflows/package-test.yml
|
||||
uses: ./.github/workflows/unit-test.yml
|
||||
with:
|
||||
package: client
|
||||
client-other-runtime-test:
|
||||
name: Client
|
||||
needs: client-unit-and-integration-test
|
||||
uses: ./.github/workflows/other-runtime-package-test.yml
|
||||
needs: client-unit-test
|
||||
uses: ./.github/workflows/other-runtime-unit-test.yml
|
||||
with:
|
||||
package: client
|
||||
discordeno-unit-and-integration-test:
|
||||
discordeno-unit-test:
|
||||
name: Discordeno
|
||||
needs: build-dist
|
||||
uses: ./.github/workflows/package-test.yml
|
||||
uses: ./.github/workflows/unit-test.yml
|
||||
with:
|
||||
package: discordeno
|
||||
discordeno-other-runtime-test:
|
||||
name: Discordeno
|
||||
needs: discordeno-unit-and-integration-test
|
||||
uses: ./.github/workflows/other-runtime-package-test.yml
|
||||
needs: discordeno-unit-test
|
||||
uses: ./.github/workflows/other-runtime-unit-test.yml
|
||||
with:
|
||||
package: discordeno
|
||||
gateway-unit-and-integration-test:
|
||||
gateway-unit-test:
|
||||
name: Gateway
|
||||
needs: build-dist
|
||||
uses: ./.github/workflows/package-test.yml
|
||||
uses: ./.github/workflows/unit-test.yml
|
||||
with:
|
||||
package: gateway
|
||||
gateway-integration-test:
|
||||
name: Gateway
|
||||
needs: build-dist
|
||||
uses: ./.github/workflows/integration-test.yml
|
||||
with:
|
||||
package: gateway
|
||||
gateway-other-runtime-test:
|
||||
name: Gateway
|
||||
needs: gateway-unit-and-integration-test
|
||||
uses: ./.github/workflows/other-runtime-package-test.yml
|
||||
needs: [gateway-unit-test, gateway-integration-test]
|
||||
uses: ./.github/workflows/other-runtime-unit-test.yml
|
||||
with:
|
||||
package: gateway
|
||||
rest-unit-and-integration-test:
|
||||
rest-unit-test:
|
||||
name: Rest
|
||||
needs: build-dist
|
||||
uses: ./.github/workflows/package-test.yml
|
||||
uses: ./.github/workflows/unit-test.yml
|
||||
with:
|
||||
package: rest
|
||||
rest-e2e-test:
|
||||
name: Rest
|
||||
needs: rest-unit-and-integration-test
|
||||
needs: rest-unit-test
|
||||
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/node-migration' || github.ref == 'refs/heads/node-migration-clean' }}
|
||||
uses: ./.github/workflows/e2e-test.yml
|
||||
secrets: inherit
|
||||
@@ -180,31 +186,31 @@ jobs:
|
||||
package: rest
|
||||
rest-other-runtime-test:
|
||||
name: Rest
|
||||
needs: rest-unit-and-integration-test
|
||||
uses: ./.github/workflows/other-runtime-package-test.yml
|
||||
needs: rest-unit-test
|
||||
uses: ./.github/workflows/other-runtime-unit-test.yml
|
||||
with:
|
||||
package: rest
|
||||
utils-unit-and-integration-test:
|
||||
utils-unit-test:
|
||||
name: Utils
|
||||
needs: build-dist
|
||||
uses: ./.github/workflows/package-test.yml
|
||||
uses: ./.github/workflows/unit-test.yml
|
||||
with:
|
||||
package: utils
|
||||
utils-other-runtime-test:
|
||||
name: Utils
|
||||
needs: utils-unit-and-integration-test
|
||||
uses: ./.github/workflows/other-runtime-package-test.yml
|
||||
needs: utils-unit-test
|
||||
uses: ./.github/workflows/other-runtime-unit-test.yml
|
||||
with:
|
||||
package: utils
|
||||
bot-unit-and-integration-test:
|
||||
bot-unit-test:
|
||||
name: Bot
|
||||
needs: build-dist
|
||||
uses: ./.github/workflows/package-test.yml
|
||||
uses: ./.github/workflows/unit-test.yml
|
||||
with:
|
||||
package: bot
|
||||
bot-e2e-test:
|
||||
name: Bot
|
||||
needs: bot-unit-and-integration-test
|
||||
needs: bot-unit-test
|
||||
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/node-migration' || github.ref == 'refs/heads/node-migration-clean' }}
|
||||
uses: ./.github/workflows/e2e-test.yml
|
||||
secrets: inherit
|
||||
@@ -212,7 +218,7 @@ jobs:
|
||||
package: bot
|
||||
bot-other-runtime-test:
|
||||
name: Bot
|
||||
needs: bot-unit-and-integration-test
|
||||
uses: ./.github/workflows/other-runtime-package-test.yml
|
||||
needs: bot-unit-test
|
||||
uses: ./.github/workflows/other-runtime-unit-test.yml
|
||||
with:
|
||||
package: bot
|
||||
|
||||
+2
-1
@@ -16,6 +16,7 @@
|
||||
"test:type": "turbo run build:type",
|
||||
"test:unit-coverage": "turbo run test:unit-coverage",
|
||||
"test:unit": "turbo run test:unit",
|
||||
"test:integration": "turbo run test:integration",
|
||||
"test:deno-unit": "turbo run test:deno-unit",
|
||||
"test:e2e": "turbo run test:e2e",
|
||||
"test:test-type": "turbo run test:test-type",
|
||||
@@ -44,4 +45,4 @@
|
||||
]
|
||||
},
|
||||
"packageManager": "yarn@3.3.0"
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,14 @@
|
||||
"coverage/**"
|
||||
]
|
||||
},
|
||||
"test:integration": {
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"outputs": [
|
||||
"coverage/**"
|
||||
]
|
||||
},
|
||||
"test:test-type": {
|
||||
"dependsOn": [
|
||||
"^build:type"
|
||||
|
||||
Reference in New Issue
Block a user