-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (40 loc) · 1.3 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: CI/CD
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20.14.0'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: Run Jest tests
env:
TEST_TELEGRAM_TOKEN: ${{ secrets.TEST_TELEGRAM_TOKEN }}
TEST_USER_ID: ${{ secrets.TEST_USER_ID }}
TEST_GROUP_ID: ${{ secrets.TEST_GROUP_ID }}
TEST_GROUP_MEMBER_ID: ${{ secrets.TEST_GROUP_MEMBER_ID }}
TEST_CHANNEL_ID: ${{ secrets.TEST_CHANNEL_ID }}
run: npm test
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
continue-on-error: true
- name: Lint code
run: npm run lint
- name: Check formatting
run: npm run format:check
- name: Build
run: npm run build
- name: Publish to npm
if: ${{ github.ref == 'refs/heads/main' && success() }}
run: npm publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}