name: Test on: pull_request: push: jobs: format-test: name: Format 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-lint-${{ github.sha }} restore-keys: | ${{ runner.os }}-turbo-lint- - name: Check Formatting run: yarn lint --cache-dir=".turbo" type-test: name: Type 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:type-${{ github.sha }} restore-keys: | ${{ runner.os }}-turbo-test:type- - name: Type Test run: yarn test:type --cache-dir=".turbo" test-type-test: name: Test Type 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:test-type-${{ github.sha }} restore-keys: | ${{ runner.os }}-turbo-test:test-type- - name: Test Type Test run: yarn test:test-type --cache-dir=".turbo" unit-test: name: Unit 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:unit-${{ github.sha }} restore-keys: | ${{ runner.os }}-turbo-test:unit- - name: Unit Test run: yarn test:unit --cache-dir=".turbo" - name: Collect and upload the coverage report uses: codecov/codecov-action@v3 with: files: ./packages/client/coverage/lcov.info,./packages/discordeno/coverage/lcov.info,./packages/gateway/coverage/lcov.info,./packages/rest/coverage/lcov.info,./packages/utils/coverage/lcov.info #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