Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to reusable workflows #91

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/analyze-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Analyze Commit Messages
on:
pull_request:

permissions:
pull-requests: write
contents: write
jobs:
analyze-commits:
name: Generate docs and coverage report
uses: fingerprintjs/dx-team-toolkit/.github/workflows/analyze-commits.yml@v1
25 changes: 3 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,6 @@ on:
- '**.md'

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v2
with:
path: node_modules
key: nodemodules-${{ hashFiles('yarn.lock') }}
restore-keys: nodemodules-
- name: Install Node packages
run: yarn install
- name: Build
run: yarn build
- name: Check the distributive TypeScript declarations
run: yarn test:dts
- name: Run linter
run: yarn lint
- name: Run tests
run: yarn test
build-and-check:
name: Build project and run CI checks
uses: fingerprintjs/dx-team-toolkit/.github/workflows/build-typescript-project.yml@v1
12 changes: 12 additions & 0 deletions .github/workflows/coverage-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Check coverage for PR

on:
pull_request:

jobs:
run-tests-check-coverage:
name: Run tests & check coverage
permissions:
checks: write
pull-requests: write
uses: fingerprintjs/dx-team-toolkit/.github/workflows/coverage-diff.yml@v1
15 changes: 15 additions & 0 deletions .github/workflows/docs-and-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Generate docs and coverage

on:
push:
branches:
- main

jobs:
generate-docs-and-coverage:
name: Generate docs and coverage report
uses: fingerprintjs/dx-team-toolkit/.github/workflows/docs-and-coverage.yml@v1
with:
prepare-gh-pages-commands: |
mv docs/* ./gh-pages
mv coverage/lcov-report ./gh-pages/coverage
25 changes: 0 additions & 25 deletions .github/workflows/docs.yml

This file was deleted.

43 changes: 6 additions & 37 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,10 @@ on:
- test

jobs:
release:
name: release
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
build-and-release:
name: 'Build project, run CI checks and publish new release'
uses: fingerprintjs/dx-team-toolkit/.github/workflows/release-typescript-project.yml@v1
secrets:
GH_RELEASE_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Cache
uses: actions/cache@v2
with:
path: node_modules
key: nodemodules-${{ hashFiles('yarn.lock') }}
restore-keys: nodemodules-

- name: Install Node packages
run: yarn install

- name: Build
run: yarn build

- name: Check the distributive TypeScript declarations
run: yarn test:dts

- name: Run linter
run: yarn lint

- name: Run tests
run: yarn test

- name: Release
run: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
HUSKY: 0
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ docs

# Bundle artifact
*.jsbundle
coverage

# Ruby / CocoaPods
/ios/Pods/
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
</a>
</p>
<p align="center">
<a href="https://fingerprintjs.github.io/fingerprintjs-pro-react-native/coverage/">
<img src="https://fingerprintjs.github.io/fingerprintjs-pro-react-native/coverage/badges.svg" alt="coverage">
</a>
<a href="https://www.npmjs.com/package/@fingerprintjs/fingerprintjs-pro-react-native">
<img src="https://img.shields.io/npm/v/@fingerprintjs/fingerprintjs-pro-react-native.svg?style=flat"/>
<img src="https://img.shields.io/npm/v/@fingerprintjs/fingerprintjs-pro-react-native.svg?style=flat" alt="Current NPM version"/>
</a>
<a href="https://www.npmjs.com/package/@fingerprintjs/fingerprintjs-pro-react-native">
<img src="https://img.shields.io/npm/dm/@fingerprintjs/fingerprintjs-pro-react-native.svg" alt="Monthly downloads from NPM">
Expand Down
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
preset: 'react-native',
testRegex: '/__tests__/.+test.tsx?$',
collectCoverageFrom: ['./src/**/**.{ts,tsx}'],
coverageReporters: ['lcov', 'json-summary', ['text', { file: 'coverage.txt', path: './' }]],
}
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": "eslint --ext .js,.ts,.jsx,.tsx --ignore-path .gitignore --max-warnings 0 .",
"lint:fix": "yarn lint --fix",
"test": "jest",
"test:coverage": "jest --coverage",
"test:dts": "tsc -p check.tsconfig.json",
"docs": "typedoc src/index.ts --out docs --readme README.md",
"release": "semantic-release"
Expand Down
Loading