forked from confused-Techie/atom-backend
-
-
Notifications
You must be signed in to change notification settings - Fork 11
78 lines (68 loc) · 1.94 KB
/
ci-tests.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
# Single GitHub Action to run tests against the codebase
# This test includes integration tests and unit tests all in one.
name: CI - Tests
on:
workflow_dispatch:
workflow_run:
workflows: [ "CI - Standards" ]
types:
- completed
# Using this to prevent simultaneous runs, outdating local git cache
env:
# Setup all Environment Variables as tests check they exist.
PORT: 8080
SERVERURL: "https://test.github.com"
PAGINATE: 30
CACHETIME: 600000
GCLOUD_STORAGE_BUCKET: ""
GOOGLE_APPLICATION_CREDENTIALS: "nofile"
GH_CLIENTID: ""
GH_CLIENTSECRET: ""
GH_USERAGENT: "Pulsar-Edit Tester Bot"
GH_REDIRECTURI: "http://localhost:8080/api/oauth"
DB_HOST: ""
DB_USER: ""
DB_PASS: ""
DB_DB: ""
DB_PORT: 43
DB_SSL_CERT: ""
LOG_LEVEL: 6
LOG_FORMAT: "stdout"
# This helps some modules know they are in a test environment
NODE_ENV: "test"
PULSAR_STATUS: "dev"
RATE_LIMIT_GENERIC: 0
RATE_LIMIT_AUTH: 0
WEBHOOK_PUBLISH: ""
WEBHOOK_VERSION: ""
WEBHOOK_USERNAME: ""
jobs:
tests:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
node-version: [17.x, 18.x, 19.x]
steps:
- name: Checkout the latest code
uses: actions/checkout@v4
- name: Setup NodeJS - ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install Dependencies
run: npm install
- name: Run Tests
run: npm run test
- name: Codecov Upload
if: always() # Needed to ensure coverage is commited even on test failure
uses: codecov/codecov-action@v3
with:
files: ./coverage/clover.xml
#- name: Coveralls Upload
#if: always() # Needed to ensure coverage is commited even on test failure
#uses: coverallsapp/github-action@master
#with:
#github-token: ${{ secrets.GITHUB_TOKEN }}