Two step build. #1589
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: "PR validation" | |
| on: | |
| pull_request: | |
| types: [opened, reopened] | |
| push: | |
| branches-ignore: | |
| - staging | |
| - main | |
| jobs: | |
| run-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| prune-cache: false | |
| - name: Install Python | |
| run: uv python install 3.11 | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Run migrations | |
| run: uv run python manage.py quicksetup --noindex | |
| - name: Run Tests | |
| run: | | |
| uv run python manage.py runserver 0.0.0.0:8000 & | |
| sleep 5 && | |
| uv run pytest | |
| - name: Validate Data | |
| run: | | |
| uv run python ./scripts/data_test.py --dir ./data/v2 & | |
| uv run python ./manage.py | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Sanitize branch name | |
| run: echo "BRANCH_NAME=$(echo ${GITHUB_REF##*/} | tr '/' '-')" >> $GITHUB_ENV | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| push: false | |
| tags: open5e-api:${{ env.BRANCH_NAME }} |