Skip to content

Commit

Permalink
Merge branch 'main' into ok-nick/roi
Browse files Browse the repository at this point in the history
  • Loading branch information
scouten-adobe authored Oct 7, 2024
2 parents 70e5987 + 8b174d9 commit 03624fa
Show file tree
Hide file tree
Showing 42 changed files with 939 additions and 481 deletions.
36 changes: 36 additions & 0 deletions .commitlintrc.no-scope.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
rules:
# Body may be empty
body-empty:
level: ignore

# Description must not be empty
description-empty:
level: error

# Description must start with a capital letter and must not end with a period or space
description-format:
level: error
format: ^[A-Z0-9].*[^. ]$

# Description should be <70 chars
description-max-length:
level: warning
length: 70

# Scope may be empty
scope-empty:
level: ignore

# Subject line should exist
subject-empty:
level: error

# Type must be one of these options
type:
level: error
options:
- fix
- feat
- chore
- update
- doc
46 changes: 46 additions & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
rules:
# Body may be empty
body-empty:
level: ignore

# Description must not be empty
description-empty:
level: error

# Description must start with a capital letter and must not end with a period or space
description-format:
level: error
format: ^[A-Z0-9].*[^. ]$

# Description should be <70 chars
description-max-length:
level: warning
length: 70

# Scope must be one of the following
scope:
level: error
options:
- export_schema
- make_test_images
- sdk

# Scope may be empty
# (NOTE: Disabled for now while we work around
# https://github.com/KeisukeYamashita/commitlint-rs/issues/355.)
# scope-empty:
# level: ignore

# Subject line should exist
subject-empty:
level: error

# Type must be one of these options
type:
level: error
options:
- fix
- feat
- chore
- update
- doc
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,26 @@ updates:
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"
schedule:
interval: "daily"
commit-message:
prefix: "update"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "chore"
105 changes: 28 additions & 77 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
name: CI

on:
on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- synchronize
push:
branches: main
branches:
- main
- nightly
schedule:
- cron: "0 18 * * 1,4,6" # 1800 UTC every Monday, Thursday, Saturday

jobs:
tests-cargo:
tests:
name: Unit tests
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
rust_version: [stable, 1.74.0]
rust_version: [stable, 1.76.0]

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

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
Expand All @@ -41,11 +48,11 @@ jobs:
fail-fast: false
matrix:
target: [aarch64-unknown-linux-gnu]
rust_version: [stable, 1.74.0]
rust_version: [stable, 1.76.0]

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

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
Expand All @@ -72,7 +79,7 @@ jobs:

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

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -95,7 +102,7 @@ jobs:

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

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
Expand All @@ -118,7 +125,7 @@ jobs:

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

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
Expand All @@ -137,31 +144,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: Install clippy
run: rustup component add clippy
with:
components: clippy

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

- name: Cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -D warnings
env:
RUST_BACKTRACE: "1"
- name: Run Clippy
run: cargo clippy --all-features --all-targets -- -Dwarnings

cargo_fmt:
name: Enforce Rust code format
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@nightly
Expand All @@ -176,12 +177,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install nightly Rust toolchain
# Nightly is used here because the docs.rs build
# uses nightly and we use doc_cfg features that are
# not in stable Rust as of this writing (Rust 1.62).
# not in stable Rust as of this writing (Rust 1.76).
uses: dtolnay/rust-toolchain@nightly

- name: Run cargo docs
Expand Down Expand Up @@ -210,10 +211,10 @@ jobs:

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

- name: Audit crate dependencies
uses: EmbarkStudios/cargo-deny-action@v1
uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check ${{ matrix.checks }}

Expand All @@ -222,7 +223,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
Expand All @@ -232,53 +233,3 @@ jobs:
with:
version: latest
args: --all-targets --all-features

version_bump:
name: Ensure (MINOR) tag is used when making an API breaking change
# Change all of these steps to (MAJOR) after 1.0 release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Get latest existing tag
uses: WyriHaximus/github-action-get-previous-tag@v1
id: get-latest-tag

- name: Set new version
uses: paulhatch/semantic-version@v5.2.1
id: set-version
with:
tag_prefix: "v"
version_format: "${major}.${minor}.${patch}"
major_pattern: "(MAJOR)"
minor_pattern: "(MINOR)"

- name: Generate changelog since last tag
run: |
{
echo 'changelog<<EOF'
git log --format="* %s" ${{ steps.get-latest-tag.outputs.tag }}..HEAD | { grep -v "(IGNORE)" || :; }
echo EOF
} >> "$GITHUB_OUTPUT"
- name: "Bump crate version (NOTE: Not pushed back to repo!)"
continue-on-error: true # If no change to crate version, ignore git commit error
run: |
sed -i "s/^version = \"[^\"]*\"$/version = \"$VERSION\"/;" sdk/Cargo.toml
git config user.email "nobody@example.com"
git config --global user.name "PR validation bot"
git add .
git commit -m "DO NOT PUSH BACK TO PR: Bump crate version"
env:
VERSION: ${{ steps.set-version.outputs.version }}

- name: If this step fails, change title of the PR to include (MINOR) tag
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
package: c2pa
Loading

0 comments on commit 03624fa

Please sign in to comment.