mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 17:00:08 +00:00
191 lines
5.8 KiB
YAML
191 lines
5.8 KiB
YAML
name: Test
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
|
|
jobs:
|
|
build-type-and-test:
|
|
name: Build Type and 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-build:type-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-turbo-build:type-
|
|
- name: Build Type and Test
|
|
run: yarn build:type --cache-dir=".turbo"
|
|
|
|
build-dist:
|
|
name: Build Dist
|
|
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-build-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-turbo-build-
|
|
- name: Type Test
|
|
run: yarn build --cache-dir=".turbo"
|
|
|
|
format-test:
|
|
name: Format Test
|
|
runs-on: ubuntu-latest
|
|
needs: build-type-and-test
|
|
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-lint-${{ github.sha }}
|
|
- name: Build type cache
|
|
if: steps.turbo-cache.outputs.cache-hit != 'true'
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: .turbo
|
|
key: ${{ runner.os }}-turbo-build:type-${{ github.sha }}
|
|
- name: Check Formatting
|
|
run: yarn lint --cache-dir=".turbo"
|
|
|
|
test-type-test:
|
|
name: Test Type Test
|
|
runs-on: ubuntu-latest
|
|
needs: build-type-and-test
|
|
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:test-type-${{ github.sha }}
|
|
- name: Build type cache
|
|
if: steps.turbo-cache.outputs.cache-hit != 'true'
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: .turbo
|
|
key: ${{ runner.os }}-turbo-build:type-${{ github.sha }}
|
|
- name: Test Type Test
|
|
run: yarn test:test-type --cache-dir=".turbo"
|
|
|
|
# Not using matrix because test later on cant needs a specific job
|
|
client-test:
|
|
name: Client
|
|
needs: build-dist
|
|
uses: ./.github/workflows/package-test.yml
|
|
with:
|
|
package: client
|
|
discordeno-test:
|
|
name: Discordeno
|
|
needs: build-dist
|
|
uses: ./.github/workflows/package-test.yml
|
|
with:
|
|
package: discordeno
|
|
gateway-test:
|
|
name: Gateway
|
|
needs: build-dist
|
|
uses: ./.github/workflows/package-test.yml
|
|
with:
|
|
package: gateway
|
|
rest-test:
|
|
name: Rest
|
|
needs: build-dist
|
|
uses: ./.github/workflows/package-test.yml
|
|
with:
|
|
package: rest
|
|
utils-test:
|
|
name: Utils
|
|
needs: build-dist
|
|
uses: ./.github/workflows/package-test.yml
|
|
with:
|
|
package: utils
|
|
|
|
#integration-test:
|
|
# name: Integration Test
|
|
# runs-on: ubuntu-latest
|
|
# concurrency: integration-test
|
|
# steps:
|
|
# - uses: actions/checkout@v3
|
|
# - uses: denoland/setup-deno@main
|
|
# with:
|
|
# deno-version: v1.x
|
|
# - name: Run integration
|
|
# # if: ${{ github.actor == 'Skillz4Killz' || github.actor == 'itohatweb' }}
|
|
# run: deno test --coverage=coverage -A tests/
|
|
# env:
|
|
# DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
# UNIT_TEST_GUILD_ID: ${{ secrets.UNIT_TEST_GUILD_ID }}
|
|
# TEST_ENV: INTEGRATION
|
|
# PROXY_REST_SECRET: ${{ secrets.PROXY_REST_SECRET }}
|
|
# PROXY_REST_URL: ${{ secrets.PROXY_REST_URL }}
|
|
# - name: Create coverage report
|
|
# run: deno coverage --exclude=tests ./coverage --lcov > coverage.lcov
|
|
# - name: Collect and upload the coverage report
|
|
# uses: codecov/codecov-action@v3
|
|
# with:
|
|
# file: ./coverage.lcov
|
|
# flags: integration
|