-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 2.84 KB
/
main.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# continuous integration
name: botensky-ci
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the prod branch
push:
branches: [ main ]
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [ 18.x ]
environment: github_actions_bes
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
# npx force-resolutions : in case of Permission denied: run it locally to fix package-lock.json
run: |
echo "install"
npm install
echo "show outdated (if any)"
npm outdated --depth=3 || echo "you must think about update your dependencies :)"
- name: Run tests
env:
TZ: ${{ vars.TZ }}
NODE_ENV: ${{ vars.NODE_ENV }}
BLUESKY_SERVICE: ${{ vars.BLUESKY_SERVICE }}
BLUESKY_USERNAME: ${{ vars.BLUESKY_USERNAME }}
BLUESKY_PASSWORD: ${{ secrets.BLUESKY_PASSWORD }}
BOT_ENGINE_MIN_INTERVAL_MS: ${{ secrets.BOT_ENGINE_MIN_INTERVAL_MS }}
BOT_PLANTNET_SIMULATE: ${{ secrets.BOT_PLANTNET_SIMULATE }}
BOT_TOKEN_SIMULATION: ${{ secrets.BOT_TOKEN_SIMULATION }}
PLANTNET_API_PRIVATE_KEY: ${{ secrets.PLANTNET_API_PRIVATE_KEY }}
BOT_INACTIVITY_DELAY_MIN: 1
run: npm run ci-test
- name: Report coverage
if: github.event_name == 'pull_request'
continue-on-error: true
# uses: romeovs/[email protected] # https://github.com/romeovs/lcov-reporter-action/issues/10
uses: andybelltree/[email protected] # https://github.com/andybelltree/lcov-reporter-action/releases
with:
github-token: ${{ secrets.GH_ACTIONS_TOKEN }}
lcov-file: ./coverage/lcov.info
filter-changed-files: true
- name: Git deploy tag coverage report
uses: peaceiris/actions-gh-pages@v3
if: github.ref_type == 'tag'
with:
github_token: ${{ secrets.GH_ACTIONS_TOKEN }}
publish_branch: gh-pages
publish_dir: ./coverage/lcov-report
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: ${{ github.event.head_commit.message }}
force_orphan: true