-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from avantifellows/feature/ci
[36] Continuous integration with E2E Testing
- Loading branch information
Showing
23 changed files
with
3,001 additions
and
664 deletions.
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,39 @@ | ||
name: Code Checks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
large-files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check for large files | ||
uses: ppremk/[email protected] | ||
with: | ||
filesizelimit: 5MB | ||
|
||
quality-checks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Check ESLint | ||
run: npm run lint:check | ||
|
||
# TODO: Uncomment when code is formated by Prettier | ||
# - name: Check Prettier | ||
# run: npm run format:check |
This file was deleted.
Oops, something went wrong.
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,77 @@ | ||
name: Tests | ||
|
||
on: | ||
workflow_run: | ||
workflows: ['Code Checks'] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run Jest tests | ||
uses: willcaul/jest-github-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
test-command: 'npm run test:jest' | ||
|
||
e2e-tests-chrome: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cypress run (Chrome) | ||
uses: cypress-io/github-action@v6 | ||
env: | ||
APP_ENV: ${{ secrets.TESTING_APP_ENV }} | ||
AF_DB_URL: ${{ secrets.STAGING_AF_DB_URL }} | ||
AF_BEARER_TOKEN: ${{ secrets.STAGING_AF_BEARER_TOKEN }} | ||
with: | ||
build: npm run build | ||
start: npm run start | ||
wait-on: 'http://localhost:3000' | ||
browser: chrome | ||
|
||
e2e-tests-firefox: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cypress run (Firefox) | ||
uses: cypress-io/github-action@v6 | ||
env: | ||
APP_ENV: ${{ secrets.TESTING_APP_ENV }} | ||
AF_DB_URL: ${{ secrets.STAGING_AF_DB_URL }} | ||
AF_BEARER_TOKEN: ${{ secrets.STAGING_AF_BEARER_TOKEN }} | ||
with: | ||
build: npm run build | ||
start: npm run start | ||
wait-on: 'http://localhost:3000' | ||
browser: firefox |
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 @@ | ||
npx lint-staged |
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
import { defineConfig } from 'cypress'; | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
baseUrl: 'http://localhost:3000', | ||
supportFile: 'cypress/support/index.ts', | ||
setupNodeEvents(on, config) {}, | ||
}, | ||
}); |
Oops, something went wrong.