Build and Test Pontoon for Debian #542
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: "Build and Test Pontoon for Debian" | |
on: | |
push: | |
paths: | |
- "make-pontoon-tarball.sh" | |
- "debian/*" | |
- ".github/workflows/pontoon-tarball.yml" | |
pull_request: | |
paths: | |
- "make-pontoon-tarball.sh" | |
- "debian/**" | |
- ".github/workflows/pontoon-tarball.yml" | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
name: "Build Pontoon Tarball" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout the repository" | |
uses: actions/checkout@v4 | |
- name: "Set up Python 3.11" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: "Set up Node 16" | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: "Make Pontoon release tarball" | |
run: | | |
./make-pontoon-tarball.sh | |
- name: "Upload artifacts" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pontoon-release-tarball | |
path: ./dist/ | |
retention-days: 14 | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: "Debian 11 (bullseye)" # -> 2026-06 | |
os: ubuntu-20.04 | |
python-version: "3.9" | |
postgres-version: 13 | |
- name: "Debian 12 (bookworm)" # -> 2028-06 | |
os: ubuntu-22.04 | |
python-version: "3.11" | |
postgres-version: 15 | |
- name: "Ubuntu 22.04 (jammy)" # -> 2027-04 | |
os: ubuntu-22.04 | |
python-version: "3.10" | |
postgres-version: 14 | |
name: "${{ matrix.name }} [py${{ matrix.python-version }}, pg${{ matrix.postgres-version }}]" | |
needs: build | |
runs-on: ${{ matrix.os }} | |
services: | |
postgres: | |
image: postgres:${{ matrix.postgres-version }} | |
env: | |
POSTGRES_USER: pontoonuser | |
POSTGRES_PASSWORD: pontoonpassword | |
POSTGRES_DB: pontoondb | |
ports: | |
- 5432:5432 | |
steps: | |
- name: "Set up Python ${{ matrix.python-version }}" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: "Download Pontoon release tarball" | |
uses: actions/download-artifact@v3 | |
with: | |
name: pontoon-release-tarball | |
- name: "Extract Pontoon release tarball" | |
run: | | |
tar -xvzf pontoon_*.tar.gz | |
- name: "Write basic configuration for Pontoon" | |
run: | | |
cd pontoon-* | |
echo "SECRET_KEY=pontoonsecret" >> .env | |
echo "DATABASE_URL=postgres://pontoonuser:pontoonpassword@localhost/pontoondb" >> .env | |
echo "DJANGO_DEBUG=True" >> .env | |
- name: "Install Python dependencies" | |
run: | | |
cd pontoon-* | |
pip install -r requirements.txt | |
- name: "Make DB Migration" | |
run: | | |
cd pontoon-* | |
python manage.py migrate |