Skip to content
Merged
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
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: CI

on:
pull_request:
push:
branches:
- master

jobs:
server:
name: Server lint and unit tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: server/package-lock.json

- name: Install server dependencies
run: npm ci --ignore-scripts

- name: Run server lint
run: npm run lint

- name: Run server unit tests
run: npm test

client:
name: Client lint and unit tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: client
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 14.21.3
cache: npm
cache-dependency-path: client/package-lock.json

- name: Install client dependencies
run: npm ci

- name: Run client lint
run: npm run lint

- name: Run client unit tests
run: CI=true npm test -- --watchAll=false --passWithNoTests

cypress:
name: Cypress
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json

- name: Install root dependencies
run: npm ci

- name: Run Cypress
run: npm run cypress:run
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.21.3
1 change: 1 addition & 0 deletions client/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.21.3
6 changes: 6 additions & 0 deletions client/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build]
command = "npm ci --ignore-scripts && if node -e \"process.exit(Number(process.versions.node.split('.')[0]) >= 17 ? 0 : 1)\"; then NODE_OPTIONS=--openssl-legacy-provider npm run build; else npm run build; fi"
publish = "build"

[build.environment]
NODE_VERSION = "14.21.3"
179 changes: 89 additions & 90 deletions client/src/lib/events.js
Original file line number Diff line number Diff line change
@@ -1,146 +1,145 @@
const Events = [
{
id: "333",
scrambler: "333",
name: "3x3",
group: "WCA",
id: '333',
scrambler: '333',
name: '3x3',
group: 'WCA',
},
{
id: "222",
scrambler: "222",
name: "2x2",
group: "WCA",
id: '222',
scrambler: '222',
name: '2x2',
group: 'WCA',
},
{
id: "444",
scrambler: "444",
name: "4x4",
group: "WCA",
id: '444',
scrambler: '444',
name: '4x4',
group: 'WCA',
},
{
id: "555",
scrambler: "555",
name: "5x5",
group: "WCA",
id: '555',
scrambler: '555',
name: '5x5',
group: 'WCA',
},
{
id: "666",
scrambler: "666",
name: "6x6",
group: "WCA",
id: '666',
scrambler: '666',
name: '6x6',
group: 'WCA',
},
{
id: "777",
scrambler: "777",
name: "7x7",
group: "WCA",
id: '777',
scrambler: '777',
name: '7x7',
group: 'WCA',
},
{
id: "333bf",
scrambler: "333",
name: "3x3 Blindfolded",
group: "WCA",
id: '333bf',
scrambler: '333',
name: '3x3 Blindfolded',
group: 'WCA',
// }, {
// id: '333fm',
// scrambler: '333',
// name: '3x3x3 Fewest Moves',
},
{
id: "333oh",
scrambler: "333",
name: "3x3 One-Handed",
group: "WCA",
id: '333oh',
scrambler: '333',
name: '3x3 One-Handed',
group: 'WCA',
},
{
id: "333ft",
scrambler: "333",
name: "3x3 With Feet",
group: "WCA",
id: '333ft',
scrambler: '333',
name: '3x3 With Feet',
group: 'WCA',
},
{
id: "minx",
scrambler: "minx",
name: "Megaminx",
group: "WCA",
id: 'minx',
scrambler: 'minx',
name: 'Megaminx',
group: 'WCA',
},
{
id: "pyram",
scrambler: "pyram",
name: "Pyraminx",
group: "WCA",
id: 'pyram',
scrambler: 'pyram',
name: 'Pyraminx',
group: 'WCA',
},
{
id: "clock",
scrambler: "clock",
name: "Clock",
group: "WCA",
id: 'clock',
scrambler: 'clock',
name: 'Clock',
group: 'WCA',
},
{
id: "clock-optimal",
scrambler: "clock-optimal",
name: "Clock (Optimal)",
group: "Other",
id: 'clock-optimal',
scrambler: 'clock-optimal',
name: 'Clock (Optimal)',
group: 'Other',
},
{
id: "skewb",
scrambler: "skewb",
name: "Skewb",
group: "WCA",
id: 'skewb',
scrambler: 'skewb',
name: 'Skewb',
group: 'WCA',
},
{
id: "sq1",
scrambler: "sq1",
name: "Square-1",
group: "WCA",
id: 'sq1',
scrambler: 'sq1',
name: 'Square-1',
group: 'WCA',
},
{
id: "444bf",
scrambler: "444",
name: "4x4 Blindfolded",
group: "WCA",
id: '444bf',
scrambler: '444',
name: '4x4 Blindfolded',
group: 'WCA',
},
{
id: "555bf",
scrambler: "555",
name: "5x5 Blindfolded",
group: "WCA",
id: '555bf',
scrambler: '555',
name: '5x5 Blindfolded',
group: 'WCA',
// }, {
// id: '333mbf',
// name: '3x3x3 Multi-Blind',
},
{
id: "fto",
scrambler: "fto",
name: "FTO",
group: "Other",
id: 'fto',
scrambler: 'fto',
name: 'FTO',
group: 'Other',
},
{
id: "pll",
scrambler: "pll",
name: "PLL",
group: "Other",
id: 'pll',
scrambler: 'pll',
name: 'PLL',
group: 'Other',
},
{
id: "zbll",
scrambler: "zbll",
name: "ZBLL",
group: "Other",
id: 'zbll',
scrambler: 'zbll',
name: 'ZBLL',
group: 'Other',
},
{
id: "lse",
scrambler: "lse",
name: "Last Six Edges",
group: "Other",
id: 'lse',
scrambler: 'lse',
name: 'Last Six Edges',
group: 'Other',
},
{
id: "ru",
scrambler: "ru",
name: "RU 2gen",
group: "Other",
id: 'ru',
scrambler: 'ru',
name: 'RU 2gen',
group: 'Other',
},
];

module.exports.Events = Events;

module.exports.getNameFromId = (eventId) =>
Events.find((e) => e.id === eventId).name;
module.exports.getNameFromId = (eventId) => Events.find((e) => e.id === eventId).name;
9 changes: 9 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { defineConfig } = require('cypress');

module.exports = defineConfig({
e2e: {
specPattern: 'cypress/e2e/**/*.cy.js',
supportFile: false,
video: false,
},
});
5 changes: 5 additions & 0 deletions cypress/e2e/ci_smoke.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('Cypress CI wiring', () => {
it('runs Cypress specs in CI', () => {
cy.wrap('letscube').should('equal', 'letscube');
});
});
7 changes: 7 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build]
base = "client"
command = "npm ci --ignore-scripts && if node -e \"process.exit(Number(process.versions.node.split('.')[0]) >= 17 ? 0 : 1)\"; then NODE_OPTIONS=--openssl-legacy-provider npm run build; else npm run build; fi"
publish = "build"

[build.environment]
NODE_VERSION = "14.21.3"
Loading
Loading