Skip to content

Rainforest QA Run #1290

Rainforest QA Run

Rainforest QA Run #1290

Workflow file for this run

name: Rainforest QA Run
# There's only one Rainforest server, so this workflow must wait for the previous run to end.
# The queue length is 1, so with multiple PRs merged at once, this workflow will only be run twice in total.
# See https://github.com/pixiebrix/pixiebrix-extension/pull/7562#discussion_r1485159972
concurrency:
group: one-rainforest-server
# For now, we'll manually trigger the run. We might consider the pull_request review_requested or push to main
# event triggers in the future. These will require potentially cleanly dealing with concurrent runs
# https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
# https://frontside.com/blog/2020-05-26-github-actions-pull_request/
on:
workflow_dispatch:
push:
branches:
- main
- release/**
schedule:
- cron: "0 8 * * *" # 8am UTC -> 3am EST
jobs:
rainforestqa:
runs-on: ubuntu-latest
env:
RAINFOREST_RUN_GROUP_MAIN: 14129
RAINFOREST_RUN_GROUP_RELEASE: 14130
RAINFOREST_RUN_GROUP_CWS: 14131
# The following environment variables are set so sourceMapPublicUrl, and there SOURCE_MAP_PUBLIC_PATH, is defined in the build
PUBLIC_RELEASE: true
SOURCE_MAP_URL_BASE: https://pixiebrix-extension-source-maps.s3.amazonaws.com
# Use mv2 because that's currently what the Rainforest build uses, see "npm run build" step below
SOURCE_MAP_PATH: sourcemaps/build/${{ github.sha }}/mv2
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: npm
- run: npm ci
- run: npm run build
env:
MV: 2
DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
DATADOG_APPLICATION_ID: ${{ secrets.DATADOG_APPLICATION_ID }}
CHROME_MANIFEST_KEY: ${{ secrets.CHROME_MANIFEST_PROD_PUBLIC_KEY }}
# https://stackoverflow.com/a/58142637
# GitHub doesn't support if-else, so we need separate steps
- name: Determine if main branch
run: |
echo "BUILD_PATH=builds/pixiebrix-extension-main.zip" >> $GITHUB_ENV
echo "RUN_GROUP=$RAINFOREST_RUN_GROUP_MAIN" >> $GITHUB_ENV
if: github.ref_name == 'main'
- name: Determine if release branch
run: |
echo "BUILD_PATH=builds/pixiebrix-extension-release.zip" >> $GITHUB_ENV
echo "RUN_GROUP=$RAINFOREST_RUN_GROUP_RELEASE" >> $GITHUB_ENV
if: startsWith(github.ref_name, 'release/')
- name: Determine if CWS release branch
# shell script used because GitHub actions doesn't support regex in if statements
# will overwrite the previous step correctly if it's a CWS-release branch
run: |
if [[ $ref_name =~ ^release\/[0-9]+.[0-9]+.[0-9]+$ ]]; then
echo "BUILD_PATH=builds/pixiebrix-extension-cws.zip" >> $GITHUB_ENV
echo "RUN_GROUP=$RAINFOREST_RUN_GROUP_CWS" >> $GITHUB_ENV
fi
env:
ref_name: ${{ github.ref_name }}
- name: Upload Extension
run: bash scripts/upload-extension.sh ${{ env.BUILD_PATH }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SOURCEMAP_USER_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SOURCEMAP_USER_KEY }}
AWS_DEFAULT_REGION: "us-east-2"
- name: Reset Test Account Data
run: |
curl -H "Authorization: Token $TOKEN" -X POST https://app.pixiebrix.com/api/tests/seed/rainforest/
env:
TOKEN: ${{ secrets.TEST_ACCOUNT_KEY }}
- name: Install Rainforest QA CLI
run: |
curl -sL $(curl -s https://api.github.com/repos/rainforestapp/rainforest-cli/releases/latest | jq -r '.assets[].browser_download_url | select(test("linux-amd64.tar.gz"))') | tar zxf - rainforest
# https://github.com/rainforestapp/rainforest-cli
- name: Run Rainforest QA Extension Test Suite
# Can't pass cancel for conflict because while we're generating a separate Rainforest QA environment for each run
# they're all using the same server
# Use --fail-fast so that we're not using GitHub build minutes if not necessary
run: |
./rainforest run \
--fail-fast \
--automation-max-retries 1 \
--description "pixiebrix-extension - ${{ github.ref_name }} ${{ github.job }}" \
--run-group $RUN_GROUP \
--release "${{ github.sha }}" \
--conflict cancel-all
env:
RAINFOREST_API_TOKEN: ${{ secrets.RAINFORESTQA_TOKEN }}
# The run group for tests to run during CI, now has start URL built-in
RUN_GROUP: ${{ env.RUN_GROUP }}
- name: Slack Notification
if: failure()
uses: rtCamp/action-slack-notify@v2
with:
status: ${{ job.status }}
notify_when: "failure"
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: rainforest-notifications
SLACK_MESSAGE: "Rainforest run failed"
SLACK_COLOR: ${{ job.status }}