-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Add manually triggered CI test suite #1688
Merged
+162
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,162 @@ | ||
name: Automated Tests | ||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
EDITOR_DIRECTORY: editor.planx.uk | ||
PNPM_VERSION: 7.8.0 | ||
NODE_VERSION: 16.13.1 | ||
|
||
jobs: | ||
integration_tests: | ||
name: Run Integration tests | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.PIZZA_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.PIZZA_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: eu-west-2 | ||
- name: Copy .env files from Staging S3 to the current working directory with AWS CLI | ||
run: ./scripts/pull-secrets.sh | ||
- name: Check if .env files exist | ||
id: check_files | ||
uses: andstor/file-existence-action@v1 | ||
with: | ||
files: ".env, .env.staging, api.planx.uk/.env.test, hasura.planx.uk/.env.test" | ||
fail: true | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: "pnpm" | ||
cache-dependency-path: "**/pnpm-lock.yaml" | ||
- run: pnpm install --frozen-lockfile | ||
working-directory: ${{ env.EDITOR_DIRECTORY }} | ||
- name: Start test containers | ||
run: ./scripts/start-containers-for-tests.sh | ||
- name: Postgres Tests | ||
run: ./hasura.planx.uk/run-postgres-tests.sh | ||
- run: pnpm i -g hasura-cli | ||
- name: Hasura Tests | ||
run: pnpm install --frozen-lockfile && pnpm test | ||
working-directory: hasura.planx.uk/tests | ||
|
||
api_tests: | ||
name: Run API Tests | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.PIZZA_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.PIZZA_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: eu-west-2 | ||
- name: Copy .env files from Staging S3 to the current working directory with AWS CLI | ||
run: ./scripts/pull-secrets.sh | ||
- name: Check if .env files exist | ||
id: check_files | ||
uses: andstor/file-existence-action@v1 | ||
with: | ||
files: ".env, .env.staging, api.planx.uk/.env.test, hasura.planx.uk/.env.test" | ||
fail: true | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: "pnpm" | ||
cache-dependency-path: "**/pnpm-lock.yaml" | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
working-directory: api.planx.uk | ||
- name: Run API Tests | ||
run: pnpm install --frozen-lockfile && pnpm check --quiet && pnpm test | ||
working-directory: api.planx.uk | ||
|
||
test_react: | ||
name: Run React Tests | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.PIZZA_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.PIZZA_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: eu-west-2 | ||
- name: Copy .env files from Staging S3 to the current working directory with AWS CLI | ||
run: ./scripts/pull-secrets.sh | ||
- name: Check if .env files exist | ||
id: check_files | ||
uses: andstor/file-existence-action@v1 | ||
with: | ||
files: ".env, .env.staging, api.planx.uk/.env.test, hasura.planx.uk/.env.test" | ||
fail: true | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: "pnpm" | ||
cache-dependency-path: "**/pnpm-lock.yaml" | ||
- run: pnpm install --frozen-lockfile | ||
working-directory: ${{ env.EDITOR_DIRECTORY }} | ||
- run: pnpm build | ||
working-directory: ${{ env.EDITOR_DIRECTORY }} | ||
- run: pnpm test | ||
working-directory: ${{ env.EDITOR_DIRECTORY }} | ||
|
||
end_to_end_tests: | ||
name: E2E tests | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.PIZZA_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.PIZZA_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: eu-west-2 | ||
- name: Copy .env files from Staging S3 to the current working directory with AWS CLI | ||
run: ./scripts/pull-secrets.sh | ||
- name: Setup PNPM | ||
uses: pnpm/[email protected] | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: "pnpm" | ||
cache-dependency-path: "**/pnpm-lock.yaml" | ||
- name: PNPM Install | ||
run: pnpm install --frozen-lockfile | ||
working-directory: e2e | ||
- name: Code checks | ||
run: pnpm check | ||
working-directory: e2e | ||
- name: Install Playwright Dependencies | ||
run: pnpm playwright install --with-deps | ||
working-directory: e2e | ||
- name: Start test containers | ||
run: ./scripts/start-containers-for-tests.sh | ||
- name: Playwright Tests | ||
run: pnpm test | ||
working-directory: e2e | ||
- name: Archive Playwright Test Results | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: playwright-report | ||
path: e2e/test-results/ | ||
retention-days: 3 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will these
PIZZA_
variables actually work if this is triggered on themain
branch do you think? Just thinking about recent scenarios of broken Notify templates where it'd be convenient to check/compare state ofmain
, not a local PR branch?testing actions is tricky though so happy for this to merge & fix forward if needed 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't specific to a Vultr deployment but general AWS keys. I was aiming to change as little as possible to make future de-duping easier later and I think this should work 🤞