-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (126 loc) · 3.88 KB
/
actions.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: ci
permissions:
pull-requests: write
issues: write
repository-projects: write
contents: write
on:
pull_request:
push:
branches: [main]
jobs:
backend:
name: "Check backend"
runs-on: ubuntu-20.04
steps:
- run: sudo apt-get install --yes graphviz
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
caster-back/setup.cfg
caster-back/requirements*.txt
./requirements-docs.txt
./requirements-dev.txt
- run: pip3 install -r requirements-dev.txt
- uses: pre-commit/[email protected]
with:
extra_args: --files caster-back/* --files *.* --files docs/* --files caster-sound/*
- run: ./caster-back/run_tests.sh
name: "Run tests"
continue-on-error: true
- uses: 5monkeys/cobertura-action@master
if: ${{ github.actor != 'dependabot[bot]' }}
continue-on-error: true
with:
path: caster-back/coverage.xml
repo_token: ${{ secrets.GITHUB_TOKEN }}
minimum_coverage: 50
- name: Backend Test Report
uses: dorny/test-reporter@v1
if: ${{ github.actor != 'dependabot[bot]' }}
continue-on-error: true
with:
name: Test reporting
path: caster-back/mypy-tests.xml,caster-back/tests.xml
reporter: java-junit
- run: make -C docs html
name: "Build documentation"
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
if: success() && github.ref == 'refs/heads/main' # only deploy main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
cname: docs.gencaster.org
editor:
name: "Check Editor"
runs-on: "ubuntu-20.04"
container: cypress/browsers:node16.16.0-chrome107-ff107
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
cache-dependency-path: |
caster-editor/package-lock.json
- run: npm ci
working-directory: caster-editor
- uses: pre-commit/[email protected]
with:
extra_args: --files caster-editor/*
- run: npm run type-check
working-directory: caster-editor
name: "Run type checks"
- name: Cypress run
uses: cypress-io/github-action@v5 # use the explicit version number
with:
browser: chrome
build: npm run build
start: npm run dev
working-directory: caster-editor
frontend:
name: "Check Frontend"
runs-on: "ubuntu-20.04"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
cache-dependency-path: |
caster-front/package-lock.json
- run: npm ci
working-directory: caster-front
- uses: pre-commit/[email protected]
with:
extra_args: --files caster-front/*
- run: npm run type-check
working-directory: caster-front
name: "Run type checks"
deploy-dev:
if: success() && github.ref == 'refs/heads/main' # only deploy main
needs: ["editor", "backend", "frontend"]
name: Deploy dev
runs-on: ubuntu-20.04
concurrency: "dev_deployment"
steps:
- name: Deploy dev environment
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
cd gencaster
docker compose down
git reset --hard
git pull origin main
make docker-deploy-dev