Skip to content

Commit 7dbf0bc

Browse files
ErikCHErik Hanchett
andauthored
added new workflow for fileuploader (#2878)
Co-authored-by: Erik Hanchett <[email protected]>
1 parent 6d5a770 commit 7dbf0bc

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Description: This workflow runs unit + e2e tests on PRs targeting
2+
# - `fileuploader/main`
3+
#
4+
# Triggered by:
5+
# (1) Internal PRs: maintainer pushes a commit to PRs targeting those branches.
6+
# (2) Fork PRs: maintainer adds "run-test" label to PRs targeting those branches.
7+
8+
name: Test / file-uploader / PRs
9+
10+
concurrency:
11+
group: e2e-${{ github.event.pull_request.id }}
12+
cancel-in-progress: true
13+
14+
on:
15+
pull_request_target:
16+
branches: [fileuploader/main]
17+
types: [opened, synchronize, labeled]
18+
19+
permissions:
20+
pull-requests: write # used to remove label
21+
# other permissions are defaulted to "none"
22+
23+
jobs:
24+
setup:
25+
runs-on: ubuntu-latest
26+
# We run tests only if it's:
27+
# 1) pull request not from a fork (ie. internal PR), or
28+
# 2) pull request from a fork (ie. external PR) that was added "run-tests" label
29+
if: |
30+
(github.event.pull_request.head.repo.full_name == github.repository) ||
31+
(github.event.action == 'labeled' && github.event.label.name == 'run-tests')
32+
steps:
33+
- name: Remove run-tests label, if applicable
34+
if: always() && github.event.label.name == 'run-tests'
35+
uses: actions/[email protected]
36+
with:
37+
github-token: ${{ secrets.GITHUB_TOKEN }}
38+
script: |
39+
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
40+
const label = 'run-tests';
41+
github.issues.removeLabel({ owner, repo, issue_number, name: label });
42+
test:
43+
uses: aws-amplify/amplify-ui/.github/workflows/reusable-e2e.yml@fileuploader/main
44+
needs: setup
45+
with:
46+
commit: ${{ github.event.pull_request.head.sha }}
47+
repository: ${{ github.event.pull_request.head.repo.full_name }}
48+
secrets:
49+
# TODO: migrate away from this account once tfn is migrated
50+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
51+
# TODO: migrate away from this account once tfn is migrated
52+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
53+
AWS_ACCESS_KEY_ID_AUTH: ${{ secrets.AWS_ACCESS_KEY_ID_AUTH }}
54+
AWS_SECRET_ACCESS_KEY_AUTH: ${{ secrets.AWS_SECRET_ACCESS_KEY_AUTH }}
55+
AWS_ACCESS_KEY_ID_DATASTORE: ${{ secrets.AWS_ACCESS_KEY_ID_DATASTORE }}
56+
AWS_SECRET_ACCESS_KEY_DATASTORE: ${{ secrets.AWS_SECRET_ACCESS_KEY_DATASTORE }}
57+
AWS_ACCESS_KEY_ID_GEO: ${{ secrets.AWS_ACCESS_KEY_ID_GEO }}
58+
AWS_SECRET_ACCESS_KEY_GEO: ${{ secrets.AWS_SECRET_ACCESS_KEY_GEO }}
59+
DOMAIN: ${{ secrets.DOMAIN }}
60+
PHONE_NUMBER: ${{ secrets.PHONE_NUMBER }}
61+
USERNAME: ${{ secrets.USERNAME }}
62+
NEW_PASSWORD: ${{ secrets.NEW_PASSWORD }}
63+
VALID_PASSWORD: ${{ secrets.VALID_PASSWORD }}
64+
SITE_URL: ${{ secrets.SITE_URL }}
65+
DOCSEARCH_DOCS_APP_ID: ${{ secrets.DOCSEARCH_DOCS_APP_ID }}
66+
DOCSEARCH_DOCS_API_KEY: ${{ secrets.DOCSEARCH_DOCS_API_KEY }}
67+
DOCSEARCH_DOCS_INDEX_NAME: ${{ secrets.DOCSEARCH_DOCS_INDEX_NAME }}

0 commit comments

Comments
 (0)