Ansible Scrolling Output (#38) #429
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: Labyrinth Tests | |
on: push | |
jobs: | |
backend-tests: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB: 1 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Start custom docker network | |
run: docker network create labyrinth || true | |
- name: Bring up dockers | |
run: bash start_dev.sh | |
- name: List Dockers | |
run: docker ps | |
- name: List Docker logs (backend) | |
run: docker logs labyrinth-backend-1 | |
- name: List Docker logs | |
run: docker logs labyrinth-alertmanager-1 | |
- name: Copy .env.sample to backend | |
run: cp backend/.env.sample backend/.env | |
- name: Backend Tests | |
run: bash backend/run_tests.sh | |
frontend-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '10' | |
cache: 'npm' | |
cache-dependency-path: frontend/labyrinth | |
- name: Install vue | |
run: npm install -g @vue/cli | |
- name: NPM install | |
run: cd frontend/labyrinth && npm install | |
- name: Run NPM tests | |
run: cd frontend/labyrinth && npm run test:unit | |
linting: | |
runs-on: ubuntu-latest | |
needs: [frontend-tests, backend-tests] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '10' | |
cache: 'npm' | |
cache-dependency-path: frontend/labyrinth | |
- name: Install vue | |
run: npm install -g @vue/cli | |
- name: NPM install | |
run: cd frontend/labyrinth && npm install | |
- name: Vue Linting | |
run: cd frontend/labyrinth && npm run lint --fix | |
- name: Sets up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' # Version range or exact version of a Python version to use, using SemVer's version range syntax | |
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified | |
- name: Install Black | |
run: pip3 install black | |
- name: Lint - Run Black | |
run: cd backend && black . | |
- name: Git Config | |
run: git pull && git config --local user.email "[email protected]" && git config --local user.name "Automatic Linting" | |
- name: Extract branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
- name: Commit updated files | |
run: git commit -m "Automatic linting fix" -a || true | |
- name: Push changes | |
run: git push |