Skip to content
Open
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
19 changes: 0 additions & 19 deletions .eslintrc

This file was deleted.

175 changes: 0 additions & 175 deletions .eslintrc-base.json

This file was deleted.

97 changes: 42 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,54 @@
name: Coderadio-client ci
name: CI

on: [push, pull_request]
on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ubuntu-20.04

strategy:
matrix:
node-version: [20.x]

runs-on: ubuntu-latest
steps:
- name: Checkout Source Files
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2

- name: Install modules
run: npm ci

- name: Run ESLint
run: npm run lint

cypress-run:
name: Cypress Test
# Netlify deploys onto Ubuntu 20.04, so we should test on that os:
runs-on: ubuntu-20.04
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm run lint

test:
name: Unit tests and build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm test
- run: npm run build

e2e:
name: Cypress (${{ matrix.browser }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browsers: [chrome, firefox]
node-version: [20.x]
browser: [chrome, firefox]
steps:
- name: Set Action Environment Variables
run: |
echo "CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }}" >> $GITHUB_ENV
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
echo "CYPRESS_INSTALL_BINARY=6.0.0" >> $GITHUB_ENV

- name: Checkout
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2

- name: Cypress run
uses: cypress-io/github-action@v2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
- uses: cypress-io/github-action@18016a55674bd02cabf197de5762a1710cb5577c # v7.4.9
with:
browser: ${{ matrix.browsers }}
browser: ${{ matrix.browser }}
build: npm run build
start: npm start
start: npm run preview
wait-on: http://localhost:3001
wait-on-timeout: 1200

unit-test:
name: Unit Test
runs-on: ubuntu-20.04

strategy:
matrix:
node-version: [20.x]

steps:
- name: Checkout Source Files
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2

- name: Install modules
run: npm ci

- name: Run tests
run: npm test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
.env.production.local

# production
/build
/dist

# misc
.DS_Store
Expand All @@ -36,3 +36,6 @@ yarn-error.log*

### Netlify ###
.netlify

# cypress
/cypress/screenshots
3 changes: 0 additions & 3 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
CYPRESS_INSTALL_BINARY=0
engine-strict=true
enable-pre-post-scripts=true
package-manager-strict=false
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.19.0
24

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might as well bump node to v26 here.

4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
package-lock.json
cypress/videos
cypress/screenshots
3 changes: 1 addition & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"endOfLine":"auto",
"endOfLine": "auto",
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"arrowParens": "avoid"
}

12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@

## Coderadio Client UI

This repository powers the current client application for the Code Radio at: <https://coderadio.freecodecamp.org>.
This repository powers the current client application for the Code Radio at: <https://coderadio.freecodecamp.org>.
Eventually we will move this over to our Gatsby based client application for our curriculum and user profiles.

You can learn more about the coderadio here: <https://www.freecodecamp.org/news/code-radio-24-7>

### Local setup

`npm ci` then `npm start` will open the app.
Use the Node version in `.nvmrc` (`nvm use`), then:

To send errors to Sentry: `cp sample.env .env.local` and fill in the Sentry DSN from the project settings
- `npm ci` installs dependencies
- `npm start` runs the dev server on <http://localhost:3001>
- `npm test` runs the unit tests
- `npm run e2e` starts the dev server and runs the Cypress tests
- `npm run lint` checks ESLint and Prettier

To send errors to Sentry: `cp sample.env .env.local` and fill in the Sentry DSN from the project settings. The same file lets you point a local build at a different AzuraCast server.
12 changes: 0 additions & 12 deletions cypress-install.js

This file was deleted.

9 changes: 9 additions & 0 deletions cypress.config.js
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:3001',
supportFile: false,
video: false
}
});
3 changes: 0 additions & 3 deletions cypress.json

This file was deleted.

Loading
Loading