chore: improve the ballot submission process #1341
Workflow file for this run
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
name: E2E | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 9 * * *" # run every day at 9:00 UTC | |
push: | |
branches: [main] | |
pull_request: | |
env: | |
NEXT_PUBLIC_FEEDBACK_URL: ${{ secrets.NEXT_PUBLIC_FEEDBACK_URL }} | |
NEXT_PUBLIC_MACI_START_BLOCK: ${{ secrets.NEXT_PUBLIC_MACI_START_BLOCK }} | |
NEXT_PUBLIC_MACI_SUBGRAPH_URL: ${{ secrets.NEXT_PUBLIC_MACI_SUBGRAPH_URL }} | |
NEXT_PUBLIC_TOKEN_NAME: ${{ secrets.NEXT_PUBLIC_TOKEN_NAME }} | |
NEXT_PUBLIC_MAX_VOTES_TOTAL: ${{ secrets.NEXT_PUBLIC_MAX_VOTES_TOTAL }} | |
NEXT_PUBLIC_MAX_VOTES_PROJECT: ${{ secrets.NEXT_PUBLIC_MAX_VOTES_PROJECT }} | |
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }} | |
NEXT_PUBLIC_ALCHEMY_ID: ${{ secrets.NEXT_PUBLIC_ALCHEMY_ID }} | |
NEXT_PUBLIC_START_DATE: ${{ secrets.NEXT_PUBLIC_START_DATE }} | |
NEXT_PUBLIC_REGISTRATION_END_DATE: ${{ secrets.NEXT_PUBLIC_REGISTRATION_END_DATE }} | |
NEXT_PUBLIC_REVIEW_END_DATE: ${{ secrets.NEXT_PUBLIC_REVIEW_END_DATE }} | |
NEXT_PUBLIC_VOTING_END_DATE: ${{ secrets.NEXT_PUBLIC_VOTING_END_DATE }} | |
NEXT_PUBLIC_RESULTS_DATE: ${{ secrets.NEXT_PUBLIC_RESULTS_DATE }} | |
TEST_MNEMONIC: ${{ secrets.TEST_MNEMONIC }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [20] | |
timeout-minutes: 20 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "pnpm" | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
continue-on-error: true | |
with: | |
path: | | |
~/.pnpm-store | |
node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: |- | |
pnpm install --frozen-lockfile --prefer-offline | |
- name: Install Playwright Browsers | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
run: |- | |
pnpm run install:deps | |
pnpm run install:chromium | |
working-directory: packages/e2e | |
- name: Install linux dependencies | |
run: | | |
sudo apt-get install --no-install-recommends -y \ | |
xvfb | |
- name: Copy .env.example to .env (interface) | |
run: | | |
cp .env.example .env | |
working-directory: packages/interface | |
- name: Copy .env.example to .env (e2e) | |
run: | | |
cp .env.example .env | |
working-directory: packages/e2e | |
- name: Build | |
run: pnpm run build | |
- name: Run interface | |
run: pnpm run start & | |
working-directory: packages/interface | |
- name: Build cache | |
run: xvfb-run pnpm run build:cache | |
working-directory: packages/e2e | |
env: | |
NEXT_PUBLIC_ALCHEMY_ID: ${{ secrets.NEXT_PUBLIC_ALCHEMY_ID }} | |
- name: Run Playwright tests | |
run: xvfb-run pnpm run test:playwright:headful | |
working-directory: packages/e2e | |
env: | |
NEXT_PUBLIC_ALCHEMY_ID: ${{ secrets.NEXT_PUBLIC_ALCHEMY_ID }} | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
continue-on-error: true | |
with: | |
name: playwright-report | |
path: packages/e2e/playwright-report/ | |
retention-days: 30 |