v0.9.5: streamline production review and preserve visual direction (#11) #86
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: DIRcreative CI | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate-install-package-bilateral: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.12", "3.14"] | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Runtime versions | |
| run: | | |
| python3 --version | |
| ruby --version | |
| - name: Optional image and schema test backends | |
| run: python3 -m pip install "Pillow==12.2.0" "jsonschema==4.26.0" | |
| - name: CJK font for annotated storyboard tests | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install --yes --no-install-recommends fonts-noto-cjk | |
| - name: Restore annotated release tag | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| git fetch --force origin "refs/tags/${GITHUB_REF_NAME}:refs/tags/${GITHUB_REF_NAME}" | |
| test "$(git cat-file -t "refs/tags/${GITHUB_REF_NAME}")" = "tag" | |
| EXPECTED_COMMIT="$(git rev-parse "refs/tags/${GITHUB_REF_NAME}^{}")" | |
| test "$(git rev-parse HEAD)" = "$EXPECTED_COMMIT" | |
| git switch -C main "$EXPECTED_COMMIT" | |
| - name: Source validation | |
| env: | |
| PYTHONDONTWRITEBYTECODE: "1" | |
| run: python3 scripts/validate_project.py | |
| - name: Dependency-free visualization schema validation | |
| env: | |
| PYTHONDONTWRITEBYTECODE: "1" | |
| DIRCREATIVE_FORCE_BUILTIN_SCHEMA_VALIDATOR: "1" | |
| run: | | |
| python3 scripts/dircreative_visualization_audit.py | |
| python3 scripts/dircreative_visualization_writeback.py self-test | |
| - name: Forced builtin state validation | |
| env: | |
| PYTHONDONTWRITEBYTECODE: "1" | |
| DIRCREATIVE_FORCE_BUILTIN_SCHEMA_VALIDATOR: "1" | |
| run: | | |
| python3 scripts/dircreative_state_audit.py self-test | |
| python3 -S -m unittest tests.test_state_snapshot_media_scope tests.test_compact_state_migration | |
| - name: Dependency-free handoff validation | |
| env: | |
| PYTHONDONTWRITEBYTECODE: "1" | |
| DIRCREATIVE_FORCE_BUILTIN_SCHEMA_VALIDATOR: "1" | |
| run: | | |
| python3 -S scripts/dircreative_script_to_seedance_handoff.py self-test | |
| python3 -S scripts/dircreative_storyboard_frame_handoff.py self-test | |
| - name: Install and parity | |
| env: | |
| PYTHONDONTWRITEBYTECODE: "1" | |
| run: | | |
| TARGET="$RUNNER_TEMP/dircreative-installed" | |
| python3 scripts/install_local_skill.py --target "$TARGET" | |
| python3 scripts/dircreative_install_parity.py --target "$TARGET" | |
| python3 scripts/dircreative_acceptance_preflight.py --require-installed \ | |
| --source-root "$GITHUB_WORKSPACE" --install-target "$TARGET" | |
| cd "$TARGET" | |
| python3 scripts/validate_project.py --installed-package --allow-development-install | |
| python3 scripts/dircreative_acceptance_preflight.py --require-installed \ | |
| --source-root "$GITHUB_WORKSPACE" --install-target "$TARGET" | |
| - name: Build, verify, and install exact-commit release artifact | |
| env: | |
| PYTHONDONTWRITEBYTECODE: "1" | |
| run: | | |
| VERSION="$(cat VERSION)" | |
| DIST="$RUNNER_TEMP/dist" | |
| ARCHIVE_TARGET="$RUNNER_TEMP/dircreative-archive-installed" | |
| EXPECTED_COMMIT="$(git rev-parse HEAD)" | |
| BUILD_ARGS=(--allow-unpublished --expected-commit "$EXPECTED_COMMIT") | |
| PARITY_ARGS=() | |
| FORMAL_ARGS=( | |
| --formal-install | |
| --target "$ARCHIVE_TARGET" | |
| --artifact "$DIST/dircreative-$VERSION.tar.gz" | |
| --checksums "$DIST/SHA256SUMS" | |
| --expected-commit "$EXPECTED_COMMIT" | |
| --expected-tag "v$VERSION" | |
| --reproducible-source "$GITHUB_WORKSPACE" | |
| --allow-unpublished | |
| ) | |
| if [[ "$GITHUB_REF" == refs/tags/v* ]]; then | |
| test "$GITHUB_REF_NAME" = "v$VERSION" | |
| BUILD_ARGS=(--require-tag --expected-commit "$EXPECTED_COMMIT") | |
| PARITY_ARGS=(--verify-remote-tag) | |
| FORMAL_ARGS=( | |
| --formal-install | |
| --target "$ARCHIVE_TARGET" | |
| --artifact "$DIST/dircreative-$VERSION.tar.gz" | |
| --checksums "$DIST/SHA256SUMS" | |
| --expected-commit "$EXPECTED_COMMIT" | |
| --expected-tag "$GITHUB_REF_NAME" | |
| --reproducible-source "$GITHUB_WORKSPACE" | |
| ) | |
| fi | |
| umask 022 | |
| python3 scripts/dircreative_build_release.py "${BUILD_ARGS[@]}" --output-dir "$DIST" | |
| umask 077 | |
| python3 scripts/dircreative_build_release.py "${BUILD_ARGS[@]}" --output-dir "$RUNNER_TEMP/dist-umask-077" | |
| cmp \ | |
| "$DIST/dircreative-$VERSION.tar.gz" \ | |
| "$RUNNER_TEMP/dist-umask-077/dircreative-$VERSION.tar.gz" | |
| umask 022 | |
| python3 scripts/install_local_skill.py "${FORMAL_ARGS[@]}" | |
| python3 scripts/dircreative_install_parity.py \ | |
| --target "$ARCHIVE_TARGET" \ | |
| "${PARITY_ARGS[@]}" | |
| python3 scripts/dircreative_acceptance_preflight.py --require-installed \ | |
| --source-root "$GITHUB_WORKSPACE" --install-target "$ARCHIVE_TARGET" "${PARITY_ARGS[@]}" | |
| ( | |
| cd "$ARCHIVE_TARGET" | |
| python3 scripts/validate_project.py --installed-package | |
| python3 scripts/dircreative_acceptance_preflight.py --require-installed \ | |
| --source-root "$GITHUB_WORKSPACE" --install-target "$ARCHIVE_TARGET" "${PARITY_ARGS[@]}" | |
| ) | |
| - name: Installed archive ADCO v1 bilateral | |
| env: | |
| PYTHONDONTWRITEBYTECODE: "1" | |
| ADCO_RELEASE_SHA: c19e3f92bdf4d311ab4ed79831b344979f1df01f | |
| run: | | |
| git clone --depth 1 --branch v0.2.0 \ | |
| https://github.com/papperrollinggery/ad-creative-orchestrator.git \ | |
| "$RUNNER_TEMP/adco" | |
| ADCO_TESTED_SHA="$(git -C "$RUNNER_TEMP/adco" rev-parse HEAD)" | |
| test "$ADCO_TESTED_SHA" = "$ADCO_RELEASE_SHA" | |
| echo "ADCO_TESTED_SHA=$ADCO_TESTED_SHA" | |
| ( | |
| cd "$RUNNER_TEMP/dircreative-archive-installed" | |
| python3 scripts/dircreative_adco_native_exchange.py --adco-repo "$RUNNER_TEMP/adco" | |
| ) | |
| - name: Source and installed archive ADCO v2 bilateral | |
| env: | |
| PYTHONDONTWRITEBYTECODE: "1" | |
| ADCO_V2_SHA: 101132984166d9580589b2ba2c6590d7f88d7509 | |
| run: | | |
| git clone https://github.com/papperrollinggery/ad-creative-orchestrator.git \ | |
| "$RUNNER_TEMP/adco-v2" | |
| git -C "$RUNNER_TEMP/adco-v2" checkout --detach "$ADCO_V2_SHA" | |
| ADCO_TESTED_SHA="$(git -C "$RUNNER_TEMP/adco-v2" rev-parse HEAD)" | |
| test "$ADCO_TESTED_SHA" = "$ADCO_V2_SHA" | |
| echo "ADCO_V2_TESTED_SHA=$ADCO_TESTED_SHA" | |
| python3 scripts/dircreative_adco_native_exchange.py \ | |
| --adco-repo "$RUNNER_TEMP/adco-v2" | |
| ( | |
| cd "$RUNNER_TEMP/dircreative-archive-installed" | |
| python3 scripts/dircreative_adco_native_exchange.py \ | |
| --adco-repo "$RUNNER_TEMP/adco-v2" | |
| ) | |
| - name: Upload tagged release candidate | |
| if: startsWith(github.ref, 'refs/tags/v') && matrix.python-version == '3.12' | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: dircreative-${{ github.ref_name }} | |
| path: | | |
| ${{ runner.temp }}/dist/dircreative-*.tar.gz | |
| ${{ runner.temp }}/dist/SHA256SUMS | |
| if-no-files-found: error | |
| - name: Upload reproducibility candidate | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: reproducibility-ubuntu-py${{ matrix.python-version }} | |
| path: ${{ runner.temp }}/dist/dircreative-*.tar.gz | |
| if-no-files-found: error | |
| reproducibility-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Restore annotated release tag | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| git fetch --force origin "refs/tags/${GITHUB_REF_NAME}:refs/tags/${GITHUB_REF_NAME}" | |
| test "$(git cat-file -t "refs/tags/${GITHUB_REF_NAME}")" = "tag" | |
| EXPECTED_COMMIT="$(git rev-parse "refs/tags/${GITHUB_REF_NAME}^{}")" | |
| test "$(git rev-parse HEAD)" = "$EXPECTED_COMMIT" | |
| git switch -C main "$EXPECTED_COMMIT" | |
| - name: Build macOS reproducibility candidate | |
| env: | |
| PYTHONDONTWRITEBYTECODE: "1" | |
| run: | | |
| VERSION="$(cat VERSION)" | |
| EXPECTED_COMMIT="$(git rev-parse HEAD)" | |
| BUILD_ARGS=(--allow-unpublished --expected-commit "$EXPECTED_COMMIT") | |
| if [[ "$GITHUB_REF" == refs/tags/v* ]]; then | |
| test "$GITHUB_REF_NAME" = "v$VERSION" | |
| BUILD_ARGS=(--require-tag --expected-commit "$EXPECTED_COMMIT") | |
| fi | |
| python3 scripts/dircreative_adco_native_exchange.py --self-test | |
| python3 scripts/dircreative_media_forward_audit.py --self-test | |
| umask 022 | |
| python3 scripts/dircreative_build_release.py \ | |
| "${BUILD_ARGS[@]}" \ | |
| --output-dir "$RUNNER_TEMP/dist" | |
| umask 077 | |
| python3 scripts/dircreative_build_release.py \ | |
| "${BUILD_ARGS[@]}" \ | |
| --output-dir "$RUNNER_TEMP/dist-umask-077" | |
| cmp \ | |
| "$RUNNER_TEMP/dist/dircreative-$VERSION.tar.gz" \ | |
| "$RUNNER_TEMP/dist-umask-077/dircreative-$VERSION.tar.gz" | |
| - name: Upload macOS reproducibility candidate | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: reproducibility-macos-py3.12 | |
| path: ${{ runner.temp }}/dist/dircreative-*.tar.gz | |
| if-no-files-found: error | |
| compare-reproducibility: | |
| needs: [validate-install-package-bilateral, reproducibility-macos] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| pattern: reproducibility-* | |
| path: candidates | |
| - name: Require byte-identical artifacts across Python, umask, and OS | |
| run: | | |
| mapfile -t artifacts < <(find candidates -type f -name 'dircreative-*.tar.gz' | sort) | |
| test "${#artifacts[@]}" -eq 4 | |
| first="${artifacts[0]}" | |
| for artifact in "${artifacts[@]:1}"; do | |
| cmp "$first" "$artifact" | |
| done | |
| sha256sum "${artifacts[@]}" |