Filter ABL on REX consumer by default #414
Workflow file for this run
This file contains hidden or 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 GitHub Actions | |
| # https://stackoverflow.com/a/67136237 | |
| on: | |
| pull_request: | |
| push: | |
| workflow_dispatch: #So we can trigger Workflow runs using `gh workflow run "test.yaml" --ref branch | |
| jobs: | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout git repository 🕝 | |
| uses: actions/checkout@v3 | |
| - name: Run ShellCheck Scripts | |
| uses: ludeeus/action-shellcheck@master | |
| with: | |
| check_together: 'yes' | |
| scandir: ./scripts | |
| severity: error | |
| - name: Run ShellCheck Backend | |
| uses: ludeeus/action-shellcheck@master | |
| with: | |
| check_together: 'yes' | |
| scandir: ./backend/app/bin | |
| severity: error | |
| - name: Run ShellCheck Corgi | |
| uses: ludeeus/action-shellcheck@master | |
| with: | |
| additional_files: ./corgi | |
| severity: error | |
| - name: Set up Docker | |
| uses: crazy-max/ghaction-setup-docker@v3 | |
| - name: Start stack | |
| run: | | |
| set -e | |
| ./corgi start | |
| for i in {1..5}; do | |
| if curl -IL 'http://localhost/' &> /dev/null; then | |
| break | |
| elif [ $i -eq 5 ]; then | |
| echo "Server did not start in time" >&2 | |
| exit 1 | |
| else | |
| sleep 1 | |
| fi | |
| done | |
| - name: Frontend Unit Tests | |
| run: | | |
| set -e | |
| ./corgi compose-do dev exec frontend npm run test:unit | |
| ./corgi compose-do dev exec frontend npm run lint | |
| - name: Backend Unit Tests | |
| run: | | |
| set -e | |
| # We ignore patch version for this comparison | |
| python_version_docker="$(./corgi compose-do dev exec backend python --version | cut -d' ' -f2 | cut -d. -f-2)" | |
| python_version_repo="$(< .python-version)" | |
| if [[ "$python_version_repo" != "$python_version_docker" ]]; then | |
| echo "Python version mismatch:" | |
| echo "Repo: $python_version_repo" | |
| echo "Docker: $python_version_docker" | |
| exit 1 | |
| fi | |
| ./corgi compose-do dev exec backend pytest -vvv ./tests/unit | |
| ./corgi compose-do dev exec backend ruff check | |
| ./corgi compose-do dev exec backend ruff format --check | |
| - name: Test database | |
| run: | | |
| set -e | |
| ./corgi create-jobs | |
| ./corgi create-approved-books | |
| ./corgi create-erd | |
| if git diff --name-only | grep -E '^README' &> /dev/null; then | |
| echo "ERD did not match commit" >&2 | |
| exit 1 | |
| fi | |
| # Ensure the latest migration works backwards and forwards with | |
| # existing job data | |
| ./corgi compose-do dev exec backend alembic downgrade -1 | |
| ./corgi compose-do dev exec backend alembic upgrade head | |
| ./corgi stop |