Skip to content

Project to be archived #155

Project to be archived

Project to be archived #155

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" }'