mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-28 18:08:15 +03:00
81 lines
1.8 KiB
YAML
81 lines
1.8 KiB
YAML
name: Tachi-Server CI
|
|
|
|
env:
|
|
NODE_ENV: "test"
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
on:
|
|
push:
|
|
branches: [master, develop]
|
|
pull_request:
|
|
branches: [master, develop]
|
|
|
|
jobs:
|
|
test:
|
|
name: Build and Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install Node.js 16
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 16.x
|
|
|
|
- name: Install PNPM
|
|
uses: pnpm/action-setup@v2.0.1
|
|
with:
|
|
version: 6.0.2
|
|
|
|
# configure external dbs
|
|
- uses: supercharge/mongodb-github-action@1.4.1
|
|
- uses: supercharge/redis-github-action@1.1.0
|
|
|
|
- name: Install Dependencies
|
|
run: pnpm i
|
|
|
|
- name: Move Config File
|
|
run: mv ./.github/test.conf.json5 ./conf.json5
|
|
|
|
- name: Lint Code
|
|
run: pnpm lint
|
|
|
|
- name: Run Tests
|
|
run: pnpm fulltest
|
|
|
|
- name: Upload Coverage
|
|
if: always()
|
|
run: |
|
|
pnpm install -g codecov
|
|
cat coverage/lcov.info | codecov
|
|
# deploy:
|
|
# if: ${{ github.ref == 'master' }}
|
|
# needs: test
|
|
# name: Deploy
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - name: Checkout Code
|
|
# uses: actions/checkout@v2
|
|
|
|
# - name: Install Node.js 15
|
|
# uses: actions/setup-node@v2
|
|
# with:
|
|
# node-version: 15.x
|
|
|
|
# - name: Install PNPM
|
|
# uses: pnpm/action-setup@v2.0.1
|
|
# with:
|
|
# version: 6.0.2
|
|
|
|
# # configure external dbs
|
|
# - uses: supercharge/mongodb-github-action@1.4.1
|
|
# - uses: supercharge/redis-github-action@1.1.0
|
|
|
|
# - name: Install Dependencies
|
|
# run: pnpm i
|
|
|
|
# # for the time being, disable lint checking.
|
|
# # - name: Lint Code
|
|
# # run: pnpm lint
|