Cypress ci (test) #32
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: Cypress Tests on Multiple Configurations | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- configure-ci-test | |
# TODO change to main | |
# - main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
config: [hardhat, foundry, no_solidity_framework] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js 18.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Install Dependencies | |
run: yarn | |
- name: Install Foundry | |
if: matrix.config == 'foundry' | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
cache: false | |
- name: Start dev | |
run: yarn dev & | |
- name: Install application (Hardhat configuration) | |
if: matrix.config == 'hardhat' | |
run: yarn cli new_project_hardhat -s hardhat | |
- name: Install application (Foundry configuration) | |
if: matrix.config == 'foundry' | |
run: yarn cli new_project_foundry -s foundry | |
- name: Install application (No solidity framework configuration) | |
if: matrix.config == 'no_solidity_framework' | |
run: yarn cli new_project_no_solidity_framework -s none | |
- name: Run chain and deploy | |
working-directory: new_project_${{ matrix.config }} | |
if: matrix.config == 'hardhat' || matrix.config == 'foundry' | |
run: yarn install & yarn chain & yarn deploy | |
- name: Run Cypress tests | |
uses: cypress-io/github-action@v6 | |
with: | |
start: yarn start | |
wait-on: "http://localhost:3000" | |
working-directory: new_project_${{ matrix.config }}/packages/nextjs | |
browser: chrome | |
spec: ${{ matrix.config == 'no_solidity_framework' && 'cypress/e2e/base/base.cy.ts' || '' }} |