Skip to content

Commit

Permalink
chore: add typescript and pr check (#9)
Browse files Browse the repository at this point in the history
* chore: add typescript and pr check

* fix: script name in workflow

---------

Co-authored-by: psmyrdek <[email protected]>
  • Loading branch information
przeprogramowani and psmyrdek authored Dec 1, 2023
1 parent a12ce2b commit 4905784
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 7 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pull Request Workflow

on:
pull_request:

jobs:
create_pull_request:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install deps
run: npm ci

- name: Run tests
run: npm run test:all

- name: Create test directory
run: npm run create

4 changes: 2 additions & 2 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@types/jest": "29.5.10",
"jest": "29.7.0",
"ts-jest": "29.1.1",
"tsx": "4.5.0"
"tsx": "4.5.0",
"typescript": "5.3.2"
}
}
7 changes: 6 additions & 1 deletion tasks/2023-11-26/index.test.ts
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
// Tutaj skopiuj testy dla zadania. Uruchom je poleceniem `npm test`
// Tutaj skopiuj testy dla zadania. Uruchom je poleceniem `npm test`
import { exampleFunction } from "."

test('should return 2', () => {
exampleFunction()
})
5 changes: 4 additions & 1 deletion tasks/2023-11-26/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
// Tutaj skopiuj kod zadania
// Tutaj skopiuj kod zadania
export function exampleFunction() {
return 2;
}
7 changes: 6 additions & 1 deletion tasks/2023-11-27/index.test.ts
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
// Tutaj skopiuj testy dla zadania. Uruchom je poleceniem `npm test`
// Tutaj skopiuj testy dla zadania. Uruchom je poleceniem `npm test`
import { exampleFunction } from "."

test('should return 2', () => {
exampleFunction()
})
5 changes: 4 additions & 1 deletion tasks/2023-11-27/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
// Tutaj skopiuj kod zadania
// Tutaj skopiuj kod zadania
export function exampleFunction() {
return 4;
}

0 comments on commit 4905784

Please sign in to comment.