This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 70
65 lines (64 loc) · 2.42 KB
/
command-pr-integration-tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: pull request command
on:
pull_request:
types: [opened] # discoverability
issue_comment:
types: [created]
jobs:
integration-tests:
if: ${{
github.event.issue.pull_request &&
github.event.comment.body == '/run integration-tests' &&
github.event.comment.user.id == 7851860 }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
go: ['1.19']
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Get dependencies
run: go mod download
- name: test
env:
DISGORD_TOKEN_INTEGRATION_TEST: ${{ secrets.DISGORD_TOKEN_INTEGRATION_TEST }}
TEST_GUILD_ADMIN_ID: ${{ secrets.TEST_GUILD_ADMIN_ID }}
TEST_GUILD_ADMIN_TEXT_GENERAL: ${{ secrets.TEST_GUILD_ADMIN_TEXT_GENERAL }}
TEST_GUILD_TYPICAL_ID: ${{ secrets.TEST_GUILD_TYPICAL_ID }}
TEST_GUILD_TYPICAL_TEXT_GENERAL: ${{ secrets.TEST_GUILD_TYPICAL_TEXT_GENERAL }}
TEST_GUILD_TYPICAL_VOICE_1: ${{ secrets.TEST_GUILD_TYPICAL_VOICE_1 }}
TEST_GUILD_TYPICAL_VOICE_2: ${{ secrets.TEST_GUILD_TYPICAL_VOICE_2 }}
TEST_GUILD_TYPICAL_VOICE_GENERAL: ${{ secrets.TEST_GUILD_TYPICAL_VOICE_GENERAL }}
LAST_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: go test -v -race -tags=integration -coverprofile=coverage-integration.txt -covermode=atomic ./...
- name: Check for success
if: ${{ success() }}
env:
URL: ${{ github.event.issue.comments_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl \
-X POST \
$URL \
-H "Content-Type: application/json" \
-H "Authorization: token $GITHUB_TOKEN" \
--data '{ "body": ":heavy_check_mark: integration tests succeeded\n\nFor commit: ' + ${{env.LAST_COMMIT_MESSAGE}} + '" }'
- name: Check for failure
if: ${{ failure() }}
env:
URL: ${{ github.event.issue.comments_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl \
-X POST \
$URL \
-H "Content-Type: application/json" \
-H "Authorization: token $GITHUB_TOKEN" \
--data '{ "body": ":x: integration tests failed" }'