Merge pull request #13 from erseco/copilot/fix-black-formatting-errors #62
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
| # ./.github/workflows/ci.yml | |
| name: CI | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| cache: 'pip' # caching pip dependencies | |
| - name: Install dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| pip install -e . | |
| - name: Lint | |
| run: make lint | |
| - name: Cache Docker images | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/docker-cache | |
| key: ${{ runner.os }}-docker-${{ hashFiles('docker-compose.yml') }} | |
| - name: Load cached Docker images | |
| run: | | |
| if [ -f /tmp/docker-cache/postgres.tar ]; then docker load -i /tmp/docker-cache/postgres.tar; fi | |
| if [ -f /tmp/docker-cache/moodle.tar ]; then docker load -i /tmp/docker-cache/moodle.tar; fi | |
| - name: Start Moodle with Docker Compose (in backgroud) | |
| run: make upd | |
| - name: Run tests | |
| run: make test | |
| - name: Run example_script.py | |
| run: python example_script.py | |
| - name: Save Docker images to cache | |
| if: always() | |
| run: | | |
| mkdir -p /tmp/docker-cache | |
| docker save postgres:alpine -o /tmp/docker-cache/postgres.tar | |
| docker save erseco/alpine-moodle:v4.5.5 -o /tmp/docker-cache/moodle.tar | |