Skip to content

Commit

Permalink
Apply prettier fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ulgens committed Dec 13, 2024
1 parent 4ae78d6 commit eaa9cfe
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 149 deletions.
70 changes: 35 additions & 35 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
name: Create and publish a Docker image

on:
push:
branches: ['main']
push:
branches: ["main"]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=true
tags: |
type=ref,event=branch
type=sha
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=true
tags: |
type=ref,event=branch
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
36 changes: 18 additions & 18 deletions .github/workflows/docker-test-build.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: Docker test build

on:
pull_request:
push:
branches:
- main
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
contents: read

jobs:
build-image:
runs-on: ubuntu-latest
build-image:
runs-on: ubuntu-latest

# steps taken (and trimmed) from docker-publish.yml
steps:
- name: Checkout repository
uses: actions/checkout@v2
# steps taken (and trimmed) from docker-publish.yml
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: false
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: false
28 changes: 14 additions & 14 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: Linters

on:
pull_request:
push:
branches:
- main
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
contents: read

jobs:
black:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: black
uses: psf/black@stable
black:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: black
uses: psf/black@stable
114 changes: 57 additions & 57 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
name: Tests

on:
pull_request:
push:
branches:
- main
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
contents: read

env:
DJANGO_SETTINGS_MODULE: tracdjangoplugin.settings_tests
# passlib has a conditional import for `crypt` which is going away in python 3.13
# and therefore throwing warnings
PYTHONWARNINGS: >
error,
default:::passlib.utils,
DJANGO_SETTINGS_MODULE: tracdjangoplugin.settings_tests
# passlib has a conditional import for `crypt` which is going away in python 3.13
# and therefore throwing warnings
PYTHONWARNINGS: >
error,
default:::passlib.utils,
jobs:
noshadows:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install "tinycss2>=1.2.0"
- run: python noshadows.py --tests
noshadows:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install "tinycss2>=1.2.0"
- run: python noshadows.py --tests

tracdjangoplugin:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install system package dependencies
run: |
sudo apt-get update
sudo apt-get -y install subversion
- name: Install requirements
run: python -m pip install -r requirements.txt
- name: Run tests
run: python -m django test tracdjangoplugin.tests
tracdjangoplugin:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install system package dependencies
run: |
sudo apt-get update
sudo apt-get -y install subversion
- name: Install requirements
run: python -m pip install -r requirements.txt
- name: Run tests
run: python -m django test tracdjangoplugin.tests

traccheck:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install system package dependencies
run: |
sudo apt-get update
sudo apt-get -y install subversion
- name: Install requirements
run: python -m pip install -r requirements.txt
- name: Lint Trac configuration
run: python traccheck.py lint trac-env/
- name: Check frozen Trac components
run: python traccheck.py components --check .TRACFREEZE.txt trac-env/
traccheck:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install system package dependencies
run: |
sudo apt-get update
sudo apt-get -y install subversion
- name: Install requirements
run: python -m pip install -r requirements.txt
- name: Lint Trac configuration
run: python traccheck.py lint trac-env/
- name: Check frozen Trac components
run: python traccheck.py components --check .TRACFREEZE.txt trac-env/
57 changes: 32 additions & 25 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
services:
trac:
image: ghcr.io/django/code.djangoproject.com:latest
# Comment out to use the ghcr.io image:
build:
context: ./
dockerfile: Dockerfile
command: ["gunicorn", "--bind", "0:9000", "--reload", "tracdjangoplugin.wsgi"]
environment:
- TRAC_INI_database=postgres://code.djangoproject:secret@db/code.djangoproject
- SECRETS_FILE=/code/secrets.json
volumes:
- ./:/code/
ports:
- 9000:9000
depends_on:
- db
db:
image: postgres:14-alpine
ports:
# Port 5435 might be handy for loading trac.sql from the djangoproject.com repo
- 5435:5432
environment:
- POSTGRES_USER=code.djangoproject
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=code.djangoproject
trac:
image: ghcr.io/django/code.djangoproject.com:latest
# Comment out to use the ghcr.io image:
build:
context: ./
dockerfile: Dockerfile
command:
[
"gunicorn",
"--bind",
"0:9000",
"--reload",
"tracdjangoplugin.wsgi",
]
environment:
- TRAC_INI_database=postgres://code.djangoproject:secret@db/code.djangoproject
- SECRETS_FILE=/code/secrets.json
volumes:
- ./:/code/
ports:
- 9000:9000
depends_on:
- db
db:
image: postgres:14-alpine
ports:
# Port 5435 might be handy for loading trac.sql from the djangoproject.com repo
- 5435:5432
environment:
- POSTGRES_USER=code.djangoproject
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=code.djangoproject

0 comments on commit eaa9cfe

Please sign in to comment.