Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -15,8 +15,8 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-22.04
build-and-publish-image:
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,10 +1,18 @@
name: Test on Docker CI
name: Run unit tests on Docker container

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

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-22.04
run-unit-tests:
runs-on: ubuntu-24.04

steps:
- name: Checkout code
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/run-unit-tests-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Run unit tests on macOS

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

permissions:
contents: read

env:
POSTGRES_DB: scancodeio
POSTGRES_USER: scancodeio
POSTGRES_PASSWORD: scancodeio

jobs:
run-unit-tests:
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: Set up Python ${{ matrix.python-version }}
uses: ikalnytskyi/action-setup-postgres@v7
id: postgres
with:
postgres-version: "14" # 13 is not supported.
database: ${{ env.POSTGRES_DB }}
username: ${{ env.POSTGRES_USER }}
password: ${{ env.POSTGRES_PASSWORD }}
port: 5432

- 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 }}
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml → .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Test CI
name: Run unit tests

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

permissions:
contents: read

env:
POSTGRES_DB: scancodeio
Expand All @@ -9,8 +17,8 @@ env:
POSTGRES_INITDB_ARGS: --encoding=UTF-8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8

jobs:
build:
runs-on: ubuntu-22.04
run-unit-tests:
runs-on: ubuntu-24.04

services:
postgres:
Expand Down
12 changes: 2 additions & 10 deletions scanpipe/tests/pipes/test_scancode.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ def test_scanpipe_pipes_scancode_extract_archive_errors(self):
errors = scancode.extract_archive(input_location, target)

error_message = "gzip decompression failed"
if sys.platform == "darwin":
error_message += " (zlib returned error -3, msg invalid code lengths set)"

expected = {input_location: [error_message]}
self.assertEqual(expected, errors)
self.assertIn(error_message, errors[str(input_location)][0])

def test_scanpipe_pipes_scancode_extract_archives(self):
tempdir = Path(tempfile.mkdtemp())
Expand Down Expand Up @@ -113,11 +109,7 @@ def test_scanpipe_pipes_scancode_extract_archives_errors(self):
errors = scancode.extract_archives(tempdir)

error_message = "gzip decompression failed"
if sys.platform == "darwin":
error_message += " (zlib returned error -3, msg invalid code lengths set)"

expected = {str(target): [error_message]}
self.assertEqual(expected, errors)
self.assertIn(error_message, errors[str(target)][0])

@skipIf(sys.platform != "linux", "QCOW2 extraction is not available on macOS.")
def test_scanpipe_pipes_scancode_extract_archive_vmimage_qcow2(self):
Expand Down
1 change: 1 addition & 0 deletions scanpipe/tests/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@ def test_scanpipe_inspect_packages_with_resolved_dependencies_poetry(self):
)
self.assertPipelineResultEqual(expected_file, result_file)

@skipIf(sys.platform == "darwin", "Not supported on macOS")
def test_scanpipe_resolved_dependencies_cocoapods(self):
pipeline_name = "resolve_dependencies"
project1 = make_project()
Expand Down