Skip to content

Commit

Permalink
Merge pull request #1306 from oasisprotocol/lw/node18
Browse files Browse the repository at this point in the history
Upgrade CI to node v18
  • Loading branch information
lukaw3d authored Mar 3, 2023
2 parents 8106429 + ba450df commit ef76686
Show file tree
Hide file tree
Showing 5 changed files with 507 additions and 367 deletions.
37 changes: 12 additions & 25 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v3
id: yarn-cache
with:
node-version: 14.x
node-version: 18
cache: 'yarn'
- if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
Expand All @@ -25,12 +25,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn lint --max-warnings 0
Expand All @@ -42,12 +40,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn test --coverage
Expand All @@ -63,12 +59,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: REACT_APP_E2E_TEST=1 yarn build:ext
Expand All @@ -79,9 +73,7 @@ jobs:
- name: Install playwright's system dependencies
working-directory: ./playwright/
run: npx playwright install --with-deps
- uses: emilioschepis/[email protected]
with:
url: 'http://localhost:5000/'
- run: npx wait-on http://localhost:5000/ --timeout 60000
- name: Run playwright tests (with xvfb-run to support headed extension test)
working-directory: ./playwright/
run: BASE_URL=http://localhost:5000 EXTENSION_PATH=../build-ext/ xvfb-run yarn test
Expand All @@ -98,10 +90,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: docker-compose pull
Expand All @@ -110,12 +102,7 @@ jobs:
continue-on-error: true
- run: REACT_APP_LOCALNET=1 REACT_APP_BACKEND=oasismonitor yarn start &
- run: docker-compose up --build -d
- uses: emilioschepis/[email protected]
with:
url: 'http://localhost:3000/'
expected-status: 200
timeout: 20000
interval: 500
- run: npx wait-on http://localhost:3000/ --timeout 60000
- run: yarn cypress:run
- name: 'Upload coverage report'
uses: actions/upload-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
fetch-depth: 0

# Install dependencies
- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18
cache: 'yarn'
- run: yarn install --frozen-lockfile

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@
"stylelint": "15.2.0",
"stylelint-config-recommended": "10.0.1",
"ts-jest": "29.0.5",
"typescript": "4.9.5"
"typescript": "4.9.5",
"wait-on": "7.0.1"
},
"resolutions": {
"@ledgerhq/hw-transport": "^6.27.6",
Expand Down
12 changes: 10 additions & 2 deletions src/app/components/DateFormatter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@ const dateFormat = new Intl.DateTimeFormat(process?.env?.NODE_ENV === 'test' ? '
timeZone: process?.env?.NODE_ENV === 'test' ? 'UTC' : undefined,
})

export const intlDateTimeFormat = (date: Date | number) => dateFormat.format(date)
/**
* Narrow No-Brake Space
*
* This is used by the date formatter.
* See https://unicodeplus.com/U+202F
*/
const NNBSP = '\u202F'

export const intlDateTimeFormat = (date: Date | number) => dateFormat.format(date).replaceAll(NNBSP, ' ')

export function DateFormatter(props: Props) {
return <>{intlDateTimeFormat(props.date)}</>
return <>{intlDateTimeFormat(props.date).replaceAll(NNBSP, ' ')}</>
}
Loading

0 comments on commit ef76686

Please sign in to comment.