-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from mrhenry/more-cleanup--generous-lionfish-37…
…a13114d8 more cleanup
- Loading branch information
Showing
3 changed files
with
9 additions
and
166 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 |
---|---|---|
@@ -1,18 +1,16 @@ | ||
name: Test Polyfills | ||
on: | ||
pull_request: | ||
repository_dispatch: | ||
types: [ok-to-test-command] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: browserstack | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# Branch-based pull request | ||
integration-trusted: | ||
test: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository | ||
strategy: | ||
max-parallel: 1 | ||
fail-fast: false | ||
|
@@ -59,97 +57,3 @@ jobs: | |
env: | ||
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} | ||
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | ||
|
||
# Repo owner has commented /ok-to-test on a (fork-based) pull request | ||
integration-fork: | ||
runs-on: ubuntu-latest | ||
if: | ||
github.event_name == 'repository_dispatch' && | ||
github.event.client_payload.slash_command.sha != '' && | ||
contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.sha) | ||
strategy: | ||
max-parallel: 1 | ||
fail-fast: false | ||
matrix: | ||
browser: [ ie, android, chrome, edge, firefox, ios, safari ] | ||
steps: | ||
# Check out merge commit | ||
- name: Fork based /ok-to-test checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge' | ||
fetch-depth: 50 | ||
|
||
# Fetch master branch to determine which polyfills have changed and need testing. | ||
- name: Fetch upstream to determine diff | ||
run: | | ||
git remote add upstream https://github.com/mrhenry/polyfill-library.git | ||
git fetch --depth=50 upstream master | ||
# <insert integration tests needing secrets> | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 16.x | ||
cache: 'npm' | ||
|
||
- name: env | ||
run: echo "commit-sha=${{github.event.client_payload.slash_command.sha}}" >> $GITHUB_ENV | ||
|
||
- run: npm ci | ||
|
||
- name: cache __dist | ||
id: cache-dist | ||
uses: actions/[email protected] | ||
with: | ||
path: polyfills/__dist | ||
key: cache--dist--${{ env.commit-sha }} | ||
|
||
- run: npm run build | ||
if: steps.cache-dist.outputs.cache-hit != 'true' | ||
|
||
- name: Test ${{ matrix.browser }} | ||
run: node ./test/polyfills/server.js & node ./test/polyfills/remotetest.js | ||
test-modified-only targeted director browser=${{ matrix.browser }} | ||
timeout-minutes: 30 | ||
env: | ||
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} | ||
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | ||
|
||
update-check-fork: | ||
needs: [integration-fork] | ||
runs-on: ubuntu-latest | ||
if: ${{ always() }} | ||
steps: | ||
# Update check run called "test-polyfills" | ||
- uses: actions/github-script@v1 | ||
id: update-check-run | ||
if: needs.integration-fork.result != 'skipped' | ||
env: | ||
number: ${{ github.event.client_payload.pull_request.number }} | ||
job: ${{ github.job }} | ||
# Conveniently, job.status maps to https://developer.github.com/v3/checks/runs/#update-a-check-run | ||
conclusion: ${{ needs.integration-fork.result }} | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const { data: pull } = await github.pulls.get({ | ||
...context.repo, | ||
pull_number: process.env.number | ||
}); | ||
const ref = pull.head.sha; | ||
const { data: checks } = await github.checks.listForRef({ | ||
...context.repo, | ||
ref | ||
}); | ||
const check = checks.check_runs.filter(c => c.name === process.env.job); | ||
const { data: result } = await github.checks.update({ | ||
...context.repo, | ||
check_run_id: check[0].id, | ||
status: 'completed', | ||
conclusion: process.env.conclusion | ||
}); | ||
return result; |
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