Skip to content

Commit

Permalink
chore: Merge c2patool repo into c2pa-rs (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
scouten-adobe authored Dec 10, 2024
2 parents f2ee9e3 + 8facb08 commit 2a65756
Show file tree
Hide file tree
Showing 51 changed files with 8,732 additions and 20 deletions.
16 changes: 1 addition & 15 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,7 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "sdk"
schedule:
interval: "daily"
commit-message:
prefix: "update"

- package-ecosystem: "cargo"
directory: "export_schema"
schedule:
interval: "daily"
commit-message:
prefix: "update"

- package-ecosystem: "cargo"
directory: "make_test_images"
directory: "/"
schedule:
interval: "daily"
commit-message:
Expand Down
54 changes: 53 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,59 @@ jobs:
- name: Generate code coverage
env:
RUST_BACKTRACE: "1"
run: cargo llvm-cov --workspace --all-features --lcov --output-path lcov.info
run: cargo llvm-cov --lib --all-features --lcov --output-path lcov.info

# Tokens aren't available for PRs originating from forks,
# so we don't attempt to upload code coverage in that case.
- name: Upload code coverage results
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]'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true

tests-cli:
name: Unit tests (c2patool)
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]
rust_version: [stable]

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

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_version }}
components: llvm-tools-preview

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Generate code coverage
env:
RUST_BACKTRACE: "1"
run: cargo llvm-cov --bins --all-features --lcov --output-path lcov.info

# Tokens aren't available for PRs originating from forks,
# so we don't attempt to upload code coverage in that case.
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,50 @@ jobs:
commit_user_name: Adobe CAI Team
commit_user_email: [email protected]
create_branch: true

# ---- TO DO: Figure out how to run this job but only when nightly-snapshot changes the branch. ----
# publish-nightly-binaries:
# name: Publish c2patool nightly binaries
# runs-on: ${{ matrix.os }}
# needs: nightly-snapshot

# strategy:
# fail-fast: false
# matrix:
# os: [windows-latest, macos-latest, ubuntu-latest]
# include:
# - os: macos-latest
# artifact_name: c2patool_mac_universal.zip
# - os: ubuntu-latest
# artifact_name: c2patool_linux_intel.tar.gz
# - os: windows-latest
# artifact_name: c2patool_win_intel.zip

# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# with:
# ref: nightly

# - name: Install Rust toolchain
# uses: dtolnay/rust-toolchain@stable

# - name: Cache Rust dependencies
# uses: Swatinem/rust-cache@v2

# - name: Run cargo check
# run: cd cli && cargo check

# - name: Run cargo test --all
# run: cd cli && cargo test --all

# - name: Build nightly release artifacts
# run: cd cli && make release

# - name: Upload build as artifact
# uses: actions/upload-artifact@v3
# with:
# path: target/${{ matrix.artifact_name }}
# name: ${{ matrix.artifact_name }}
# retention-days: 15
# if-no-files-found: error
73 changes: 73 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,76 @@ jobs:
tail -n +2 |\
sed 's/origin\///' |\
xargs -I {} git push origin --delete {}
- name: Identify c2patool release tag
run: |
echo "TO DO: Identify c2patool release tag, if any"
exit 1
# publish-c2patool-binaries:
# name: Publish c2patool binaries
# runs-on: ${{ matrix.os }}
# needs: release-plz

# strategy:
# fail-fast: false
# matrix:
# os: [ macos-latest, ubuntu-latest, windows-latest ]
# rust_version: [ stable ]
# experimental: [ false ]
# include:
# - os: macos-latest
# artifact_name: c2patool_mac_universal.zip
# uploaded_asset_name: c2patool-${{ needs.repo-prep.outputs.new-tag }}-universal-apple-darwin.zip
# - os: ubuntu-latest
# artifact_name: c2patool_linux_intel.tar.gz
# uploaded_asset_name: c2patool-${{ needs.repo-prep.outputs.new-tag }}-x86_64-unknown-linux-gnu.tar.gz
# - os: windows-latest
# artifact_name: c2patool_win_intel.zip
# uploaded_asset_name: c2patool-${{ needs.repo-prep.outputs.new-tag }}-x86_64-pc-windows-msvc.zip

# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# with:
# ref: ${{ needs.repo-prep.outputs.commit-hash }}

# - name: Install Rust toolchain
# uses: dtolnay/rust-toolchain@master
# with:
# toolchain: ${{ matrix.rust_version }}
# components: llvm-tools-preview

# - name: Install cargo-sbom
# uses: baptiste0928/cargo-install@v3
# with:
# crate: cargo-sbom
# version: '0.9.1'

# - name: Cache Rust dependencies
# uses: Swatinem/rust-cache@v2

# - name: Run make release
# run: make release

# - name: Upload binary to GitHub
# uses: svenstaro/upload-release-action@v1-release
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: target/${{ matrix.artifact_name }}
# asset_name: ${{ matrix.uploaded_asset_name }}
# tag: ${{ needs.repo-prep.outputs.new-tag }}
# overwrite: true

# - name: Generate SBOM
# run: cargo sbom > c2patool.${{ matrix.os }}.sbom.json

# - name: Upload SBOM to Github
# uses: svenstaro/upload-release-action@v1-release
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: c2patool.${{ matrix.os }}.sbom.json
# asset_name: c2patool-${{ needs.repo-prep.outputs.new-tag }}-sbom.json
# tag: ${{ needs.repo-prep.outputs.new-tag }}
# overwrite: true

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ Cargo.lock
.vscode

/semver-checks/target/

# Unit test output lands here. TO DO: Fix
cli/target
Loading

0 comments on commit 2a65756

Please sign in to comment.