Removing in-door on start #801
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |