Skip to content

Commit

Permalink
chore: fix workflows and add codecove coverage action
Browse files Browse the repository at this point in the history
  • Loading branch information
imranbarbhuiya committed May 28, 2023
1 parent 1cd54c0 commit e1519f9
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .github/uploadCoverage/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Upload Coverage'
description: 'Uploads code coverage reports to codecov with separate flags for separate packages'
runs:
using: 'composite'
steps:
- name: Upload Fanbook Coverage
uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 # v3
with:
files: ./packages/fanbook.js/coverage/cobertura-coverage.xml
flags: fanbook

- name: Upload Fanbook Rest Coverage
uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 # v3
with:
files: ./packages/rest/coverage/cobertura-coverage.xml
flags: rest
3 changes: 2 additions & 1 deletion .github/workflows/auto-deprecate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
jobs:
auto-deprecate:
name: NPM Auto Deprecate
if: github.repository_owner == 'fanbookjs'
# TODO: enable later
if: github.repository_owner == 'fanbookjs' && false
runs-on: ubuntu-latest
steps:
- name: Checkout Project
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
CodeQL:
runs-on: ubuntu-latest

permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Install Dependencies
uses: ./.github/yarnCache
- name: Compile Projects
run: yarn build
run: yarn build && yarn typecheck
- name: Upload fanbook dist folders to artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
with:
Expand Down Expand Up @@ -81,4 +81,4 @@ jobs:

- name: Upload Coverage
if: github.repository_owner == 'fanbookjs'
uses: ./scripts/uploadCoverage
uses: ./.github/uploadCoverage
2 changes: 2 additions & 0 deletions .github/workflows/deprecate-on-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
deprecate-on-merge:
name: NPM Deprecate PR versions On Merge
runs-on: ubuntu-latest
# TODO: enable later
if: false
steps:
- name: Checkout Project
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/labelsync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
label_sync:
name: Automatic Label Synchronization
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout Project
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"lint": "turbo run lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"typecheck": "turbo run typecheck",
"test": "turbo run test",
"postinstall": "husky install .github/husky"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/rest/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const works = 'It works!';
7 changes: 7 additions & 0 deletions packages/rest/tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { works } from '../src/index.js';

describe('works', () => {
test('should work', () => {
expect(works).toBe('It works!');
});
});
7 changes: 7 additions & 0 deletions packages/rest/tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"types": ["vitest/globals"]
},
"include": ["."]
}

0 comments on commit e1519f9

Please sign in to comment.