Merge pull request #2 from MJSEC-MJU/dev #7
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 | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: ["**"] | |
| jobs: | |
| django: | |
| name: Django checks and tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Cache pip | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
| restore-keys: ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Django system checks | |
| env: | |
| DJANGO_SETTINGS_MODULE: suika_game.settings | |
| run: | | |
| python manage.py check | |
| python manage.py makemigrations --check --dry-run | |
| - name: Run tests | |
| env: | |
| DJANGO_SETTINGS_MODULE: suika_game.settings | |
| run: python manage.py test --noinput -v 2 | |
| docker-build: | |
| name: Docker build (sanity) | |
| runs-on: ubuntu-latest | |
| needs: django | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build image | |
| run: docker build -t suika-game-ci . |