Skip to content

Commit

Permalink
feat: update deps and node version on CI (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkampitakis committed Apr 17, 2023
1 parent bfd575d commit 216bb94
Show file tree
Hide file tree
Showing 12 changed files with 3,229 additions and 3,053 deletions.
4 changes: 1 addition & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
Expand All @@ -24,4 +22,4 @@
"node": true,
"es6": true
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/ciPR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '18'
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn test
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ciPush.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '18'
- run: yarn
- run: yarn lint
- run: yarn test
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '18'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Release
Expand Down
4 changes: 2 additions & 2 deletions lib/index.js

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@
"lint": "eslint src/**/*.ts"
},
"devDependencies": {
"@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1",
"@semantic-release/changelog": "^6.0.1",
"@commitlint/cli": "^17.6.1",
"@commitlint/config-conventional": "^17.6.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@spotify/eslint-config": "^13.0.0",
"@types/jest": "^27.4.1",
"@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"@vercel/ncc": "^0.33.3",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.4",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.4",
"jest": "^27.5.1",
"prettier": "^2.6.2",
"semantic-release": "^19.0.2",
"ts-jest": "^27.1.4",
"typescript": "^4.6.3"
"@spotify/eslint-config": "^14.1.6",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@vercel/ncc": "^0.36.1",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.3",
"jest": "^29.5.0",
"prettier": "^2.8.7",
"semantic-release": "^21.0.1",
"ts-jest": "^29.1.0",
"typescript": "^5.0.4"
},
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/github": "^5.0.1"
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1"
},
"jest": {
"globals": {
"ts-jest": {
"diagnostics": false
"transform": {
"^.+\\.ts$": ["ts-jest"]
}
},
"verbose": true,
Expand Down
4 changes: 2 additions & 2 deletions src/pr-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export async function getFiles({
});

const untracked = ['removed', 'unchanged'];
let matcher = (file: typeof prFiles[number]) =>
let matcher = (file: (typeof prFiles)[number]) =>
!untracked.includes(file.status) && Boolean(file.additions);

if (ignoreFilesPattern) {
const regex = new RegExp(ignoreFilesPattern);
matcher = (file: typeof prFiles[number]) =>
matcher = (file: (typeof prFiles)[number]) =>
!untracked.includes(file.status) &&
Boolean(file.additions) &&
!file.filename.match(regex);
Expand Down
6 changes: 3 additions & 3 deletions tests/__snapshots__/action-paramaters.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`getActionParameters should return action parameters 1`] = `
Object {
{
"actor": "mock-actor",
"base": "master",
"head": "pr",
Expand All @@ -12,11 +12,11 @@ Object {
`;

exports[`getInputs should return all inputs 1`] = `
Object {
{
"commentTitle": "my title",
"ignoreFilesPattern": "mock-pattern",
"reviewMsg": "hello world",
"tags": Array [
"tags": [
"test:",
"data:",
"more",
Expand Down
70 changes: 35 additions & 35 deletions tests/__snapshots__/file-analyzer.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`FileAnalyzer should return all comments if no patch provided 1`] = `
Array [
Object {
"comments": Object {
"FIXME:": Array [
Object {
[
{
"comments": {
"FIXME:": [
{
"comment": ":add implementation",
"line": 6,
},
],
"NOTE": Array [
Object {
"NOTE": [
{
"comment": "Please don't forget review",
"line": 12,
},
Object {
{
"comment": "another note",
"line": 13,
},
],
"tODo:": Array [
Object {
"tODo:": [
{
"comment": "this is an old comment",
"line": 8,
},
Object {
{
"comment": "this should present",
"line": 11,
},
Object {
{
"comment": "placeholder function",
"line": 16,
},
Expand All @@ -41,27 +41,27 @@ Array [
`;

exports[`FileAnalyzer should return all identified comments 1`] = `
Array [
Object {
"comments": Object {
"FIXME:": Array [
Object {
[
{
"comments": {
"FIXME:": [
{
"comment": ":add implementation",
"line": 6,
},
],
"NOTE": Array [
Object {
"NOTE": [
{
"comment": "Please don't forget review",
"line": 12,
},
],
"tODo:": Array [
Object {
"tODo:": [
{
"comment": "this should present",
"line": 11,
},
Object {
{
"comment": "placeholder function",
"line": 16,
},
Expand All @@ -73,21 +73,21 @@ Array [
`;

exports[`FileAnalyzer should skip comments not included on the pr 1`] = `
Array [
Object {
"comments": Object {
"NOTE": Array [
Object {
[
{
"comments": {
"NOTE": [
{
"comment": "another note",
"line": 13,
},
],
"tODo:": Array [
Object {
"tODo:": [
{
"comment": "this should present",
"line": 11,
},
Object {
{
"comment": "placeholder function",
"line": 16,
},
Expand All @@ -99,11 +99,11 @@ Array [
`;

exports[`FileAnalyzer should skip files with no matches 1`] = `
Array [
Object {
"comments": Object {
"TODO:": Array [
Object {
[
{
"comments": {
"TODO:": [
{
"comment": "we should write tests",
"line": 5,
},
Expand Down
4 changes: 2 additions & 2 deletions tests/action-paramaters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('getActionParameters', () => {
payload: {}
} as Context;

expect(() => getActionParameters(ctx)).toThrowError(
expect(() => getActionParameters(ctx)).toThrow(
'Action only supports pull requests'
);
});
Expand All @@ -49,7 +49,7 @@ describe('getActionParameters', () => {
}
} as Context;

expect(() => getActionParameters(ctx)).toThrowError(
expect(() => getActionParameters(ctx)).toThrow(
'Action cannot identify pull request number'
);
});
Expand Down
3 changes: 3 additions & 0 deletions tests/pr-files.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ const execSpy = jest.fn();
const diffCMD = 'git diff origin/master...origin/pr -- src/data.ts';

jest.mock('util', () => {
const original = jest.requireActual('util');

return {
...original,
promisify: () => async (command: string) => {
await sleep(2000);
execSpy(command);
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
"node_modules",
"tests"
]
}
}
Loading

0 comments on commit 216bb94

Please sign in to comment.