Skip to content

Commit 255ba98

Browse files
committed
fix: use yarn, generate yarn.lock, fix workflows
1 parent 39f04e5 commit 255ba98

4 files changed

Lines changed: 847 additions & 79 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
name: CI
22

33
on:
4-
push:
5-
branches: [main, develop]
6-
pull_request:
7-
branches: [main, develop]
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
88

99
jobs:
10-
lint-and-build:
11-
name: Lint, Format & Build
12-
runs-on: ubuntu-latest
13-
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v4
17-
18-
- name: Setup Node
19-
uses: actions/setup-node@v4
20-
with:
21-
node-version: 20
22-
registry-url: https://npm.pkg.github.com
23-
scope: "@backendworks"
24-
cache: npm
25-
26-
- name: Install dependencies
27-
run: npm ci
28-
env:
29-
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }}
30-
31-
- name: Generate Prisma client
32-
run: npx prisma generate
33-
34-
- name: Lint
35-
run: npm run lint
36-
37-
- name: Format check
38-
run: npx prettier --check "src/**/*.ts"
39-
40-
- name: Build
41-
run: npm run build
10+
lint-and-build:
11+
name: Lint, Format & Build
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
registry-url: https://npm.pkg.github.com
23+
scope: "@backendworks"
24+
cache: yarn
25+
26+
- name: Install dependencies
27+
run: yarn install --frozen-lockfile
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }}
30+
31+
- name: Generate Prisma client
32+
run: npx prisma generate
33+
34+
- name: Lint
35+
run: npm run lint
36+
37+
- name: Format check
38+
run: npx prettier --check "src/**/*.ts"
39+
40+
- name: Build
41+
run: npm run build

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ jobs:
4141
with:
4242
node-version: 20
4343
registry-url: https://npm.pkg.github.com
44-
scope: "@backendworks"
45-
cache: npm
44+
scope: '@backendworks'
45+
cache: yarn
4646

4747
- name: Install dependencies
48-
run: npm ci
48+
run: yarn install --frozen-lockfile
4949
env:
5050
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }}
5151

.github/workflows/test.yml

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
name: Test
22

33
on:
4-
push:
5-
branches: [main, develop]
6-
pull_request:
7-
branches: [main, develop]
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
88

99
jobs:
10-
unit-tests:
11-
name: Unit Tests
12-
runs-on: ubuntu-latest
13-
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v4
17-
18-
- name: Setup Node
19-
uses: actions/setup-node@v4
20-
with:
21-
node-version: 20
22-
registry-url: https://npm.pkg.github.com
23-
scope: "@backendworks"
24-
cache: npm
25-
26-
- name: Install dependencies
27-
run: npm ci
28-
env:
29-
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }}
30-
31-
- name: Generate Prisma client
32-
run: npx prisma generate
33-
34-
- name: Run unit tests with coverage
35-
run: npm test
36-
env:
37-
NODE_ENV: test
38-
39-
- name: Upload coverage report
40-
uses: actions/upload-artifact@v4
41-
if: always()
42-
with:
43-
name: post-db-coverage
44-
path: coverage/
45-
retention-days: 7
10+
unit-tests:
11+
name: Unit Tests
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
registry-url: https://npm.pkg.github.com
23+
scope: "@backendworks"
24+
cache: yarn
25+
26+
- name: Install dependencies
27+
run: yarn install --frozen-lockfile
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }}
30+
31+
- name: Generate Prisma client
32+
run: npx prisma generate
33+
34+
- name: Run unit tests with coverage
35+
run: npm test
36+
env:
37+
NODE_ENV: test
38+
39+
- name: Upload coverage report
40+
uses: actions/upload-artifact@v4
41+
if: always()
42+
with:
43+
name: post-db-coverage
44+
path: coverage/
45+
retention-days: 7

0 commit comments

Comments
 (0)