Skip to content

Commit

Permalink
Merge pull request #30 from Ryczko/setup-github=workflow
Browse files Browse the repository at this point in the history
Set-up Github Workflow
  • Loading branch information
xdk78 authored May 6, 2022
2 parents 1c2261e + 9176a3a commit 33b1216
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
env:
CI: 1
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run build
- run: npm run test-ci
28 changes: 28 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --watchAll=false",
"test-ci": "cross-env CI=1 react-scripts test --watchAll=false",
"test-watch": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint --ext .js,.ts,.tsx src/",
Expand Down Expand Up @@ -59,6 +60,7 @@
"@typescript-eslint/eslint-plugin": "^5.16.0",
"@typescript-eslint/parser": "^5.16.0",
"autoprefixer": "^10.4.4",
"cross-env": "^7.0.3",
"eslint": "^8.11.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
Expand Down
9 changes: 8 additions & 1 deletion src/Utils/convertTime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import {
describe('convertTime', () => {
it('should return correct date with hours', () => {
const timestamp: Timestamp = new Timestamp(1651768396, 0);
const expected = '5.05.2022, 18:33';
let expected: string;

// fix for different timezones on CI
if (process.env.CI) {
expected = '5.05.2022, 16:33';
} else {
expected = '5.05.2022, 18:33';
}
const result = formatFirebaseDateWithHours(timestamp);
expect(result).toEqual(expected);
});
Expand Down

1 comment on commit 33b1216

@vercel
Copy link

@vercel vercel bot commented on 33b1216 May 6, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

employee-pulse – ./

employee-pulse-git-dev-ryczko.vercel.app
employee-pulse.vercel.app
employee-pulse-ryczko.vercel.app

Please sign in to comment.