Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Docker image on GHCR
name: Publish Docker image on GitHub Container Registry
# https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions

on:
Expand All @@ -16,7 +16,7 @@ env:

jobs:
build-and-push-image:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: Build aboutcode.pipeline Python distributions and publish on PyPI
on:
workflow_dispatch:
push:
tags:
- "aboutcode.pipeline/*"
tags:
- "aboutcode.pipeline/*"

jobs:
build-and-publish:
name: Build and publish library to PyPI
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build-and-publish:
name: Build and publish library to PyPI
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
name: Test on Docker CI
name: Run unit tests on Docker container

on: [push, pull_request]
on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
FROM_DOCKER_IMAGE: "1"

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Generate the .env file and the SECRET_KEY
run: make envfile

- name: Build and run the Docker Compose stack
run: docker compose up -d

- name: Run tests
run: docker compose run -e FROM_DOCKER_IMAGE=1 web python ./manage.py test --verbosity=2 --noinput
run: docker compose run web python ./manage.py test --verbosity=2 --noinput
48 changes: 48 additions & 0 deletions .github/workflows/run-unit-tests-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run unit tests on macOS

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

env:
POSTGRES_DB: scancodeio
POSTGRES_USER: scancodeio
POSTGRES_PASSWORD: scancodeio

jobs:
macos-test:
runs-on: macos-13

strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies with Homebrew
run: |
brew update
brew install universal-ctags gettext postgresql
brew services start postgresql
sleep 5
createdb $POSTGRES_DB || echo "Database may already exist"

- name: Install Python dependencies
run: make dev envfile

- name: Run Django tests
run: .venv/bin/python manage.py test --verbosity=2 --noinput
env:
SCANCODEIO_DB_NAME: ${{ env.POSTGRES_DB }}
SCANCODEIO_DB_USER: ${{ env.POSTGRES_USER }}
SCANCODEIO_DB_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Test CI
name: Run unit tests

on: [push, pull_request]
on:
workflow_dispatch:
pull_request:
push:
branches:
- main

env:
POSTGRES_DB: scancodeio
Expand All @@ -10,58 +15,58 @@

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

services:
postgres:
image: postgres:13
env:
POSTGRES_DB: ${{ env.POSTGRES_DB }}
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_INITDB_ARGS: ${{ env.POSTGRES_INITDB_ARGS }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

strategy:
max-parallel: 4
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install universal ctags and xgettext
run: |
sudo apt-get update
sudo apt-get install -y universal-ctags gettext

- name: Install dependencies
run: make dev envfile

- name: Validate code format
run: make check

- name: Check Django deployment settings
run: make check-deploy

- name: Build the documentation
run: make docs

- name: Run tests
run: .venv/bin/python manage.py test --verbosity=2 --noinput
env:
SCANCODEIO_DB_NAME: ${{ env.POSTGRES_DB }}
SCANCODEIO_DB_USER: ${{ env.POSTGRES_USER }}
SCANCODEIO_DB_PASSWORD: ${{ env.POSTGRES_PASSWORD }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Loading