-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate service tests to GH actions (#8421)
* run service tests with GHA * rename GithubGist services to Gist * completely delete circle ci config
- Loading branch information
Showing
12 changed files
with
191 additions
and
277 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: 'Service tests' | ||
description: 'Run tests for selected services' | ||
inputs: | ||
github-token: | ||
description: 'The GITHUB_TOKEN secret' | ||
required: true | ||
librariesio-tokens: | ||
description: 'The SERVICETESTS_LIBRARIESIO_TOKENS secret' | ||
required: false | ||
default: '' | ||
obs-user: | ||
description: 'The SERVICETESTS_OBS_USER secret' | ||
required: false | ||
default: '' | ||
obs-pass: | ||
description: 'The SERVICETESTS_OBS_PASS secret' | ||
required: false | ||
default: '' | ||
sl-insight-user-uuid: | ||
description: 'The SERVICETESTS_SL_INSIGHT_USER_UUID secret' | ||
required: false | ||
default: '' | ||
sl-insight-api-token: | ||
description: 'The SERVICETESTS_SL_INSIGHT_API_TOKEN secret' | ||
required: false | ||
default: '' | ||
twitch-client-id: | ||
description: 'The SERVICETESTS_TWITCH_CLIENT_ID secret' | ||
required: false | ||
default: '' | ||
twitch-client-secret: | ||
description: 'The SERVICETESTS_TWITCH_CLIENT_SECRET secret' | ||
required: false | ||
default: '' | ||
wheelmap-token: | ||
description: 'The SERVICETESTS_WHEELMAP_TOKEN secret' | ||
required: false | ||
default: '' | ||
youtube-api-key: | ||
description: 'The SERVICETESTS_YOUTUBE_API_KEY secret' | ||
required: false | ||
default: '' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Derive list of service tests to run | ||
# Note: In this step we are using an intermediate env var instead of | ||
# passing github.event.pull_request.title as an argument | ||
# to prevent a shell injection attack. Further reading: | ||
# https://securitylab.github.com/research/github-actions-untrusted-input/#exploitability-and-impact | ||
# https://securitylab.github.com/research/github-actions-untrusted-input/#remediation | ||
if: always() | ||
env: | ||
TITLE: ${{ github.event.pull_request.title }} | ||
run: npm run test:services:pr:prepare "$TITLE" | ||
shell: bash | ||
|
||
- name: Run service tests | ||
if: always() | ||
run: npm run test:services:pr:run -- --reporter json --reporter-option 'output=reports/service-tests.json' | ||
shell: bash | ||
env: | ||
RETRY_COUNT: 3 | ||
GH_TOKEN: '${{ inputs.github-token }}' | ||
LIBRARIESIO_TOKENS: '${{ inputs.librariesio-tokens }}' | ||
OBS_USER: '${{ inputs.obs-user }}' | ||
OBS_PASS: '${{ inputs.obs-pass }}' | ||
SL_INSIGHT_USER_UUID: '${{ inputs.sl-insight-user-uuid }}' | ||
SL_INSIGHT_API_TOKEN: '${{ inputs.sl-insight-api-token }}' | ||
TWITCH_CLIENT_ID: '${{ inputs.twitch-client-id }}' | ||
TWITCH_CLIENT_SECRET: '${{ inputs.twitch-client-secret }}' | ||
WHEELMAP_TOKEN: '${{ inputs.wheelmap-token }}' | ||
YOUTUBE_API_KEY: '${{ inputs.youtube-api-key }}' | ||
|
||
- name: Write Markdown Summary | ||
if: always() | ||
run: | | ||
if test -f 'reports/service-tests.json'; then | ||
echo '# Services' >> $GITHUB_STEP_SUMMARY | ||
sed -e 's/^/- /' pull-request-services.log >> $GITHUB_STEP_SUMMARY | ||
node scripts/mocha2md.js Report reports/service-tests.json >> $GITHUB_STEP_SUMMARY | ||
else | ||
echo 'No services found. Nothing to do.' >> $GITHUB_STEP_SUMMARY | ||
fi | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Services@node 17 | ||
on: | ||
pull_request: | ||
types: [opened, edited, reopened, synchronize] | ||
|
||
jobs: | ||
test-services-17: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
with: | ||
node-version: 17 | ||
env: | ||
NPM_CONFIG_ENGINE_STRICT: 'false' | ||
|
||
- name: Service tests (triggered from local branch) | ||
if: github.event.pull_request.head.repo.full_name == github.repository | ||
uses: ./.github/actions/service-tests | ||
with: | ||
github-token: '${{ secrets.GH_PAT }}' | ||
librariesio-tokens: '${{ secrets.SERVICETESTS_LIBRARIESIO_TOKENS }}' | ||
obs-user: '${{ secrets.SERVICETESTS_OBS_USER }}' | ||
obs-pass: '${{ secrets.SERVICETESTS_OBS_PASS }}' | ||
sl-insight-user-uuid: '${{ secrets.SERVICETESTS_SL_INSIGHT_USER_UUID }}' | ||
sl-insight-api-token: '${{ secrets.SERVICETESTS_SL_INSIGHT_API_TOKEN }}' | ||
twitch-client-id: '${{ secrets.SERVICETESTS_TWITCH_CLIENT_ID }}' | ||
twitch-client-secret: '${{ secrets.SERVICETESTS_TWITCH_CLIENT_SECRET }}' | ||
wheelmap-token: '${{ secrets.SERVICETESTS_WHEELMAP_TOKEN }}' | ||
youtube-api-key: '${{ secrets.SERVICETESTS_YOUTUBE_API_KEY }}' | ||
|
||
- name: Service tests (triggered from fork) | ||
if: github.event.pull_request.head.repo.full_name != github.repository | ||
uses: ./.github/actions/service-tests | ||
with: | ||
github-token: '${{ secrets.GITHUB_TOKEN }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Services | ||
on: | ||
pull_request: | ||
types: [opened, edited, reopened, synchronize] | ||
|
||
jobs: | ||
test-services: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
with: | ||
node-version: 16 | ||
|
||
- name: Service tests (triggered from local branch) | ||
if: github.event.pull_request.head.repo.full_name == github.repository | ||
uses: ./.github/actions/service-tests | ||
with: | ||
github-token: '${{ secrets.GH_PAT }}' | ||
librariesio-tokens: '${{ secrets.SERVICETESTS_LIBRARIESIO_TOKENS }}' | ||
obs-user: '${{ secrets.SERVICETESTS_OBS_USER }}' | ||
obs-pass: '${{ secrets.SERVICETESTS_OBS_PASS }}' | ||
sl-insight-user-uuid: '${{ secrets.SERVICETESTS_SL_INSIGHT_USER_UUID }}' | ||
sl-insight-api-token: '${{ secrets.SERVICETESTS_SL_INSIGHT_API_TOKEN }}' | ||
twitch-client-id: '${{ secrets.SERVICETESTS_TWITCH_CLIENT_ID }}' | ||
twitch-client-secret: '${{ secrets.SERVICETESTS_TWITCH_CLIENT_SECRET }}' | ||
wheelmap-token: '${{ secrets.SERVICETESTS_WHEELMAP_TOKEN }}' | ||
youtube-api-key: '${{ secrets.SERVICETESTS_YOUTUBE_API_KEY }}' | ||
|
||
- name: Service tests (triggered from fork) | ||
if: github.event.pull_request.head.repo.full_name != github.repository | ||
uses: ./.github/actions/service-tests | ||
with: | ||
github-token: '${{ secrets.GITHUB_TOKEN }}' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.