diff options
Diffstat (limited to 'dom/webgpu/tests/cts/checkout/.github')
4 files changed, 155 insertions, 0 deletions
diff --git a/dom/webgpu/tests/cts/checkout/.github/pull_request_template.md b/dom/webgpu/tests/cts/checkout/.github/pull_request_template.md new file mode 100644 index 0000000000..7fadba0fc3 --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/.github/pull_request_template.md @@ -0,0 +1,21 @@ + + + +Issue: #<!-- Fill in the issue number here. See docs/intro/life_of.md --> + +<hr> + +**Requirements for PR author:** + +- [ ] All missing test coverage is tracked with "TODO" or `.unimplemented()`. +- [ ] New helpers are `/** documented */` and new helper files are found in `helper_index.txt`. +- [ ] Test behaves as expected in a WebGPU implementation. (If not passing, explain above.) + +**Requirements for [reviewer sign-off](https://github.com/gpuweb/cts/blob/main/docs/reviews.md):** + +- [ ] Tests are properly located in the test tree. +- [ ] [Test descriptions](https://github.com/gpuweb/cts/blob/main/docs/intro/plans.md) allow a reader to "read only the test plans and evaluate coverage completeness", and accurately reflect the test code. +- [ ] Tests provide complete coverage (including validation control cases). **Missing coverage MUST be covered by TODOs.** +- [ ] Helpers and types promote readability and maintainability. + +When landing this PR, be sure to make any necessary issue status updates. diff --git a/dom/webgpu/tests/cts/checkout/.github/workflows/pr.yml b/dom/webgpu/tests/cts/checkout/.github/workflows/pr.yml new file mode 100644 index 0000000000..5cf3d70996 --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/.github/workflows/pr.yml @@ -0,0 +1,28 @@ +name: Pull Request CI + +on: + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.1 + with: + persist-credentials: false + - run: | + git fetch origin ${{ github.event.pull_request.head.sha }} + git checkout ${{ github.event.pull_request.head.sha }} + - uses: actions/setup-node@v2-beta + with: + node-version: "15.x" + - run: npm ci + - run: npm test + - run: | + mkdir deploy-build/ + cp -r README.md src standalone out docs deploy-build/ + - uses: actions/upload-artifact@v2 + with: + name: pr-artifact + path: deploy-build/ diff --git a/dom/webgpu/tests/cts/checkout/.github/workflows/push.yml b/dom/webgpu/tests/cts/checkout/.github/workflows/push.yml new file mode 100644 index 0000000000..5f767661ab --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/.github/workflows/push.yml @@ -0,0 +1,26 @@ +name: Push CI + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.1 + with: + persist-credentials: false + - uses: actions/setup-node@v2-beta + with: + node-version: "15.x" + - run: npm ci + - run: | + npm test + mkdir deploy-build/ + cp -r README.md src standalone out out-wpt docs tools deploy-build/ + - uses: JamesIves/github-pages-deploy-action@4.1.4 + with: + BRANCH: gh-pages + FOLDER: deploy-build + CLEAN: true diff --git a/dom/webgpu/tests/cts/checkout/.github/workflows/workflow.yml b/dom/webgpu/tests/cts/checkout/.github/workflows/workflow.yml new file mode 100644 index 0000000000..0d475a269e --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/.github/workflows/workflow.yml @@ -0,0 +1,80 @@ +name: Workflow CI + +on: + workflow_run: + workflows: + - "Pull Request CI" + types: + - completed + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.1 + with: + persist-credentials: false + - run: | + PR=$(curl https://api.github.com/search/issues?q=${{ github.event.workflow_run.head_sha }} | + grep -Po "(?<=${{ github.event.workflow_run.repository.full_name }}\/pulls\/)\d*" | head -1) + echo "PR=$PR" >> $GITHUB_ENV + - uses: actions/github-script@v3 + id: pr-artifact + with: + github-token: ${{secrets.GITHUB_TOKEN}} + result-encoding: string + script: | + const artifacts_url = context.payload.workflow_run.artifacts_url + const artifacts_req = await github.request(artifacts_url) + const artifact = artifacts_req.data.artifacts[0] + const download = await github.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: artifact.id, + archive_format: "zip" + }) + return download.url + - run: | + rm -rf * + curl -L -o "pr-artifact.zip" "${{ steps.pr-artifact.outputs.result }}" + unzip -o pr-artifact.zip + rm pr-artifact.zip + - run: | + cat << EOF >> firebase.json + { + "hosting": { + "public": ".", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ] + } + } + EOF + cat << EOF >> .firebaserc + { + "projects": { + "default": "gpuweb-cts" + } + } + EOF + - id: deployment + continue-on-error: true + uses: FirebaseExtended/action-hosting-deploy@v0 + with: + firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CTS }} + expires: 10d + channelId: cts-prs-${{ env.PR }}-${{ github.event.workflow_run.head_sha }} + - uses: peter-evans/create-or-update-comment@v1 + continue-on-error: true + if: ${{ steps.deployment.outcome == 'success' }} + with: + issue-number: ${{ env.PR }} + body: | + Previews, as seen when this [build job](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}) started (${{ github.event.workflow_run.head_sha }}): + [**Run tests**](${{ steps.deployment.outputs.details_url }}/standalone/) | [**View tsdoc**](${{ steps.deployment.outputs.details_url }}/docs/tsdoc/) + <!-- + pr;head;sha + ${{ env.PR }};${{ github.event.workflow_run.head_repository.full_name }};${{ github.event.workflow_run.head_sha }} + --> |