Skip to content
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

Set up builds with multiple React versions #109

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 34 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ jobs:
- run: node --version
- run: node -p 'os.cpus()'
- run: yarn types
- run: yarn lint
- run: yarn test:unit:ci
- run: yarn build:ci
# - run: yarn lint
# - run: yarn test:unit:ci
#- run: yarn build:ci

- name: Save build folder
uses: actions/upload-artifact@v4
with:
name: build
if-no-files-found: error
path: build
# - name: Save build folder
# uses: actions/upload-artifact@v4
# with:
# name: build
# if-no-files-found: error
# path: build

ui-chrome-tests:
timeout-minutes: 15
Expand All @@ -49,23 +49,38 @@ jobs:
# https://github.com/cypress-io/github-action/issues/48
fail-fast: false
matrix:
react: ["18.2.0", "19.0.0-rc-c21bcd627b-20240624"]
# run copies of the current job in parallel
containers: [1, 2, 3, 4, 5]
containers: [1] #[1, 2, 3, 4, 5]
name: "UI Tests - React ${{ matrix.react }} (${{ matrix.containers }})"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download the build folders
uses: actions/download-artifact@v4
with:
name: build
path: build
# - name: Download the build folders
# uses: actions/download-artifact@v4
# with:
# name: build
# path: build
- name: Install custom React version
run: yarn add react@${{ matrix.react }} react-dom@${{ matrix.react }}

- name: Check React version
run: yarn why react

- name: Build
run: yarn build:ci

- name: Node info
run: node -v

- name: __e Dir
run: ls /__e
# - name: __e Dir
# run: ls /__e

# Get just the commit title, so we can have a custom run message
# determined in the Cypress config: https://stackoverflow.com/a/76513704/62937
- name: get_head_commit_title
run: echo "commit_title=$(git log --format=%B -n 1 HEAD | head -n 1)" >> $GITHUB_OUTPUT

- name: "UI Tests - Chrome"
uses: cypress-io/github-action@v6
Expand All @@ -88,6 +103,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEBUG: "cypress:server:args"
REPLAY_API_KEY: ${{ secrets.REPLAY_API_KEY }}
COMMIT_TITLE: ${{ steps.get_head_commit_title.outputs.commit_title }}
REACT_VERSION: ${{ matrix.react }}

# ui-chrome-mobile-tests:
# timeout-minutes: 15
Expand Down
7 changes: 7 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,17 @@ module.exports = defineConfig({

const on = wrapOn(cyOn);

const runTitle = process.env.COMMIT_TITLE
? `${process.env.COMMIT_TITLE} (React ${process.env.REACT_VERSION})`
: undefined;

console.log("Commit title: ", process.env.COMMIT_TITLE, "run title: ", runTitle);

replayPlugin(on, config, {
upload: true, // automatically upload your replays to DevTools

apiKey: process.env.REPLAY_API_KEY,
runTitle,
});

const queryDatabase = ({ entity, query }, callback) => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/bankaccounts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "../../backend/database";
import { User } from "../../src/models/user";
import { BankAccount } from "../../src/models/bankaccount";
describe("BankAccounts", () => {
describe.only("BankAccounts", () => {
beforeEach(() => {
seedDatabase();
});
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/comments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

import { User, Transaction } from "../../src/models";

describe("Comments", () => {
describe.skip("Comments", () => {
beforeEach(() => {
seedDatabase();
});
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/contacts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from "../../backend/database";
import { User } from "../../src/models/user";
import { totalContacts, contactsPerUser } from "../../scripts/seedDataUtils";
describe("Contacts", () => {
describe.skip("Contacts", () => {
beforeEach(() => {
seedDatabase();
});
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/likes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

import { User, Transaction } from "../../src/models";

describe("Transactions", () => {
describe.skip("Transactions", () => {
beforeEach(() => {
seedDatabase();
});
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/notifications.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
NotificationType,
} from "../../src/models";

describe("Notifications", () => {
describe.skip("Notifications", () => {
let user: User;
beforeEach(() => {
seedDatabase();
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/transactions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
import { getFakeAmount } from "../../src/utils/transactionUtils";
import { totalTransactions, transactionsPerUser } from "../../scripts/seedDataUtils";

describe("Transactions", () => {
describe.skip("Transactions", () => {
beforeEach(() => {
seedDatabase();
});
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/users.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { seedDatabase, getAllUsers, searchUsers } from "../../backend/database";

import { User } from "../models";

describe("Users", () => {
describe.skip("Users", () => {
beforeEach(() => {
seedDatabase();
});
Expand Down
Loading