Build #372
Workflow file for this run
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: Build | ||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
| - labeled | ||
| push: | ||
| branches: | ||
| - main | ||
| tags: | ||
| - "*" | ||
| workflow_dispatch: | ||
| inputs: | ||
| publish: | ||
| description: 'Publish' | ||
| required: true | ||
| default: 'false' | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| tests: | ||
| name: Unit tests (developer setup) | ||
| if: | | ||
| github.event_name != 'pull_request' || | ||
| github.event.pull_request.author_association == 'COLLABORATOR' || | ||
| github.event.pull_request.author_association == 'MEMBER' || | ||
| github.event.pull_request.user.login == 'dependabot[bot]' || | ||
| contains(github.event.pull_request.labels.*.name, 'safe to test') | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ windows-latest, macos-latest, ubuntu-latest ] | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.10" | ||
| cache: "pip" | ||
| #- name: Upgrade pip | ||
| # run: python -m pip install --upgrade pip | ||
| - name: Install project dependencies | ||
| run: python -m pip install -r requirements.txt | ||
| - name: Prepare build directories | ||
| run: | | ||
| mkdir -p artifacts | ||
| mkdir -p src/c2pa/libs | ||
| rm -rf dist/* build/* | ||
| - name: Download native artifacts | ||
| run: python3 scripts/download_artifacts.py c2pa-v0.55.0 | ||
| - name: Install package in development mode | ||
| run: | | ||
| pip uninstall -y c2pa | ||
| pip install -e . | ||
| - name: Verify installation | ||
| run: | | ||
| python3 -c "from c2pa import C2paError; print('C2paError imported successfully')" | ||
| - name: Install pytest | ||
| run: python -m pip install pytest | ||
| - name: Run tests | ||
| run: python3 ./tests/test_unit_tests.py | ||
| linux: | ||
| uses: ./.github/workflows/build-wheel.yml | ||
|
Check failure on line 84 in .github/workflows/build.yml
|
||
| with: | ||
| python-version: "3.10" | ||
| artifact-name: wheels-${{ matrix.target }} | ||
| strategy: | ||
| matrix: | ||
| target: [x86_64, aarch64] | ||
| if: | | ||
| github.event_name != 'pull_request' || | ||
| github.event.pull_request.author_association == 'COLLABORATOR' || | ||
| github.event.pull_request.author_association == 'MEMBER' || | ||
| github.event.pull_request.user.login == 'dependabot[bot]' || | ||
| contains(github.event.pull_request.labels.*.name, 'safe to test') | ||
| windows: | ||
| uses: ./.github/workflows/build-wheel.yml | ||
| with: | ||
| python-version: "3.10" | ||
| architecture: ${{ matrix.target }} | ||
| artifact-name: wheels-${{ matrix.target }} | ||
| strategy: | ||
| matrix: | ||
| target: [x64, x86] | ||
| if: | | ||
| github.event_name != 'pull_request' || | ||
| github.event.pull_request.author_association == 'COLLABORATOR' || | ||
| github.event.pull_request.author_association == 'MEMBER' || | ||
| github.event.pull_request.user.login == 'dependabot[bot]' || | ||
| contains(github.event.pull_request.labels.*.name, 'safe to test') | ||
| macos_x86: | ||
| uses: ./.github/workflows/build-wheel.yml | ||
| with: | ||
| python-version: "3.10" | ||
| artifact-name: wheels-mac-x86_64 | ||
| if: | | ||
| github.event_name != 'pull_request' || | ||
| github.event.pull_request.author_association == 'COLLABORATOR' || | ||
| github.event.pull_request.author_association == 'MEMBER' || | ||
| github.event.pull_request.user.login == 'dependabot[bot]' || | ||
| contains(github.event.pull_request.labels.*.name, 'safe to test') | ||
| macos_aarch64: | ||
| uses: ./.github/workflows/build-wheel.yml | ||
| with: | ||
| python-version: "3.10" | ||
| artifact-name: wheels-mac-aarch64 | ||
| if: | | ||
| github.event_name != 'pull_request' || | ||
| github.event.pull_request.author_association == 'COLLABORATOR' || | ||
| github.event.pull_request.author_association == 'MEMBER' || | ||
| github.event.pull_request.user.login == 'dependabot[bot]' || | ||
| contains(github.event.pull_request.labels.*.name, 'safe to test') | ||
| sdist: | ||
| runs-on: ubuntu-latest | ||
| if: | | ||
| github.event_name != 'pull_request' || | ||
| github.event.pull_request.author_association == 'COLLABORATOR' || | ||
| github.event.pull_request.author_association == 'MEMBER' || | ||
| github.event.pull_request.user.login == 'dependabot[bot]' || | ||
| contains(github.event.pull_request.labels.*.name, 'safe to test') | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.10" | ||
| cache: "pip" | ||
| - name: Install dependencies | ||
| run: pip install -r requirements.txt | ||
| - name: Build sdist | ||
| run: python setup.py sdist | ||
| - name: Upload sdist | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: wheels-sdist | ||
| path: dist | ||
| release: | ||
| name: Release | ||
| if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true' | ||
| runs-on: ubuntu-latest | ||
| environment: pypipublish | ||
| needs: [linux, windows, macos_x86, macos_aarch64, sdist] | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: wheels-* | ||
| path: dist | ||
| merge-multiple: true | ||
| - name: List contents of dist directory | ||
| run: ls -la dist/ | ||
| - name: Publish to TestPyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| packages-dir: dist | ||
| # Uncomment to use TestPyPI | ||
| repository-url: https://test.pypi.org/legacy/ | ||
| verbose: true | ||
| # Uncomment below for test runs, otherwise fails on existing packages being reuploaded | ||
| skip-existing: true | ||