Files
discordeno/.github/workflows/pr_tests.yml
Skillz4Killz fbd2aaa14f fix pr events
2021-05-06 13:53:25 +00:00

31 lines
1.0 KiB
YAML

name: Test Contributor Pull Requests
on:
pull_request:
types: [labeled, opened]
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 }}