updated CI to use latest version of this action when running tests, added more tests
This commit is contained in:
@@ -1,21 +1,65 @@
|
||||
on: [push]
|
||||
name: Tests
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
new_push_job:
|
||||
unit_tests:
|
||||
runs-on: ubuntu-latest
|
||||
name: New push to repo
|
||||
steps:
|
||||
- name: Publish to slack
|
||||
- uses: actions/checkout@v2
|
||||
- run: npm ci && npm run build
|
||||
- run: npm test
|
||||
|
||||
integration_test_botToken:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: npm ci && npm run build
|
||||
- name: Post message to Slack via botToken
|
||||
id: slack
|
||||
uses: slackapi/[email protected]
|
||||
uses: ./
|
||||
with:
|
||||
channel-id: 'CTAAHRA79'
|
||||
slack-message: 'posting from a github action!'
|
||||
payload: "{\"key\":\"value\",\"foo\":\"bar\"}"
|
||||
slack-message: 'CI Post from slack-send GitHub Action! Succeeded!!'
|
||||
# payload: "{\"key\":\"value\",\"foo\":\"bar\"}"
|
||||
env:
|
||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
|
||||
# Use the output from the `hello` step
|
||||
- name: Get the output time
|
||||
run: echo "The time was ${{ steps.hello.outputs.time }}"
|
||||
run: echo "The time was ${{ steps.slack.outputs.time }}"
|
||||
|
||||
integration_test_webhook:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: npm ci && npm run build
|
||||
- run: echo "${{ github.event_name }}"
|
||||
- name: push trigger
|
||||
# Save commit url from GitHub Trigger event payload to URL env
|
||||
if: "contains(github.event_name, 'push')"
|
||||
run: |
|
||||
url=${{ github.event.head_commit.url }}
|
||||
echo "URL=$url" >> "$GITHUB_ENV"
|
||||
- name: pull request trigger
|
||||
# Save pull request url from GitHub Trigger event payload to URL env
|
||||
if: "contains(github.event_name, 'pull_request')"
|
||||
run: |
|
||||
url=${{ github.event.pull_request.url }}
|
||||
echo "URL=$url" >> "$GITHUB_ENV"
|
||||
- name: Post message to Slack via webhook
|
||||
id: slack
|
||||
uses: ./
|
||||
with:
|
||||
# Normalized payload with info pulled out from GitHub trigger event
|
||||
payload: "{\"author\":\"${{ github.event.sender.login }}\",\"url\":\"${{ env.URL}}\", \"repoName\":\"${{ github.event.repository.full_name }}\", \"status\":\"${{ job.status }}\"}"
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
|
||||
|
||||
# Use the output from the `hello` step
|
||||
- name: Get the output time
|
||||
run: echo "The time was ${{ steps.slack.outputs.time }}"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
node_modules
|
||||
.DS_Store
|
||||
.nyc_output
|
||||
dist
|
||||
|
||||
Vendored
-19698
File diff suppressed because one or more lines are too long
Vendored
-1003
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user