mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
optimize gh acitons
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
name: Local Tests Only
|
||||
on:
|
||||
push:
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
deno: ["v1.x"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: denoland/setup-deno@main
|
||||
with:
|
||||
deno-version: ${{ matrix.deno }}
|
||||
- name: Cache dependencies
|
||||
run: deno cache mod.ts
|
||||
- name: Run Local tests that don't need Discord's API
|
||||
run: deno test -A tests/local.ts
|
||||
@@ -0,0 +1,30 @@
|
||||
name: Test Contributor Pull Requests
|
||||
on:
|
||||
pull_request:
|
||||
types: [labeled]
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
deno: ["v1.x"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: denoland/setup-deno@main
|
||||
with:
|
||||
deno-version: ${{ matrix.deno }}
|
||||
- name: Cache dependencies
|
||||
run: deno cache mod.ts
|
||||
- name: Run test script if label added
|
||||
if: ${{ github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'run-tests' }}
|
||||
run: DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} deno test --unstable --coverage=coverage -A tests/mod.ts
|
||||
env:
|
||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
||||
- name: Create coverage report
|
||||
run: deno --unstable coverage ./coverage --lcov > coverage.lcov
|
||||
- name: Collect and upload the coverage report
|
||||
uses: codecov/codecov-action@v1.0.10
|
||||
with:
|
||||
file: ./coverage.lcov
|
||||
env:
|
||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
||||
@@ -1,8 +1,6 @@
|
||||
name: Test
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
types: [labeled]
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -19,9 +17,6 @@ jobs:
|
||||
- name: Run test script for maintainers
|
||||
if: ${{ github.actor == 'Skillz4Killz' || github.actor == 'itohatweb' }}
|
||||
run: deno test --unstable --coverage=coverage -A tests/mod.ts
|
||||
- name: Run test script if label added
|
||||
if: ${{ github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'run-tests' }}
|
||||
run: DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} deno test --unstable --coverage=coverage --allow-net tests/mod.ts
|
||||
- name: Create coverage report
|
||||
run: deno --unstable coverage ./coverage --lcov > coverage.lcov
|
||||
- name: Collect and upload the coverage report
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
import "./util/utils.ts";
|
||||
import "./util/validate_length.ts";
|
||||
import "./util/loop_object.ts";
|
||||
+1
-3
@@ -3,9 +3,7 @@
|
||||
|
||||
// First complete non-api reliant testing.
|
||||
// Don't waste api rate limits if a early test fails.
|
||||
import "./util/utils.ts";
|
||||
import "./util/validate_length.ts";
|
||||
import "./util/loop_object.ts";
|
||||
import "./local.ts";
|
||||
|
||||
// API TESTING BELOW
|
||||
|
||||
|
||||
Reference in New Issue
Block a user