Skip to content

Commit

Permalink
(MINOR) Bump MSRV to 1.66.0 (#179)
Browse files Browse the repository at this point in the history
Also bumps to latest version of several GitHub actions
  • Loading branch information
scouten-adobe authored Oct 16, 2023
1 parent 28e3c34 commit bd45336
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 83 deletions.
93 changes: 35 additions & 58 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
rust_version: [stable, 1.64.0]
rust_version: [stable, 1.66.0]

steps:
- name: Checkout repository
Expand All @@ -29,14 +29,12 @@ jobs:
components: llvm-tools-preview

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v1
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 --all-features --lcov --ignore-filename-regex tests --output-path lcov.info

- name: Upload code coverage results
Expand All @@ -54,7 +52,7 @@ jobs:
fail-fast: false
matrix:
target: [aarch64-unknown-linux-gnu]
rust_version: [stable, 1.64.0]
rust_version: [stable, 1.66.0]

steps:
- name: Checkout repository
Expand All @@ -64,20 +62,20 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_version }}
targets: ${{ matrix.target }}

- name: Install cross-compilation toolset
run: cargo install cross

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

# Note that we do not run code coverage because
# it isn't readily accessible from cross-compilation
# environment. (A PR to fix this would be welcomed!)

- name: Run unit tests (cross build)
uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --all-targets --all-features --target ${{ matrix.target }}
run: cross test --all-targets --all-features --target ${{ matrix.target }}

test-default-disabled:
name: Unit tests with default features disabled
Expand All @@ -87,20 +85,16 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
rust_version: [stable]

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

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

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

- name: Run tests
run: cargo test --all-targets --no-default-features
Expand All @@ -119,13 +113,12 @@ jobs:
uses: actions/checkout@v3

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: llvm-tools-preview

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

- name: Run tests
run: cargo +nightly test -Z direct-minimal-versions --all-targets --all-features
Expand All @@ -151,7 +144,7 @@ jobs:
components: llvm-tools-preview

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

- name: Dry-run of crate publish
run: cargo publish --no-verify -p xmp_toolkit --dry-run
Expand All @@ -164,15 +157,13 @@ jobs:
uses: actions/checkout@v3

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

- name: Install clippy
run: rustup component add clippy

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

- name: Cargo clippy
uses: actions-rs/clippy-check@v1
Expand All @@ -190,16 +181,12 @@ jobs:
uses: actions/checkout@v3

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@master
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt

- name: Check format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo +nightly fmt --all -- --check

docs_rs:
name: Preflight docs.rs build
Expand All @@ -212,16 +199,14 @@ jobs:
# 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).
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
uses: dtolnay/rust-toolchain@nightly

- name: Run cargo docs
# This is intended to mimic the docs.rs build
# environment. The goal is to fail PR validation
# if the subsequent release would result in a failed
# documentation build on docs.rs.
run: cargo +nightly doc --all-features
run: cargo +nightly doc --all-features --no-deps
env:
RUSTDOCFLAGS: --cfg docsrs
DOCS_RS: 1
Expand Down Expand Up @@ -257,9 +242,7 @@ jobs:
uses: actions/checkout@v3

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
uses: dtolnay/rust-toolchain@nightly

- name: Run cargo-udeps
uses: aig787/cargo-udeps-action@v1
Expand All @@ -275,9 +258,7 @@ jobs:
uses: actions/checkout@v3

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
uses: dtolnay/rust-toolchain@nightly

- name: Check for unknown features
env:
Expand All @@ -290,20 +271,18 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Get latest existing tag
uses: actions-ecosystem/action-get-latest-tag@v1
uses: WyriHaximus/github-action-get-previous-tag@v1
id: get-latest-tag
with:
semver_only: true

- name: Set new version
uses: paulhatch/semantic-version@v5.0.2
uses: paulhatch/semantic-version@v5.2.1
id: set-version
with:
tag_prefix: "v"
Expand All @@ -312,12 +291,12 @@ jobs:
minor_pattern: "(MINOR)"

- name: Generate changelog since last tag
uses: mathiasvr/command-output@v1
## NEEDS UPDATE for set-output deprecation.
## See https://github.com/mathiasvr/command-output/issues/4.
id: changelog
with:
run: git log --format="* %s" ${{ steps.get-latest-tag.outputs.tag }}..HEAD
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
Expand All @@ -344,12 +323,10 @@ jobs:
uses: actions/checkout@v3

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

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

- name: Run example
run: cargo run --example read_xmp src/tests/fixtures/Purple\ Square.psd
39 changes: 16 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,18 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
token: ${{ secrets.GH_ADMIN_COMMIT_TOKEN }}

- name: Get latest existing tag
uses: actions-ecosystem/action-get-latest-tag@v1
## NEEDS UPDATE for set-output deprecation.
## See https://github.com/actions-ecosystem/action-get-latest-tag/issues/25.
uses: WyriHaximus/github-action-get-previous-tag@v1
id: get-latest-tag
with:
semver_only: true

- name: Set new version
uses: paulhatch/semantic-version@v5.0.2
uses: paulhatch/semantic-version@v5.2.1
id: set-version
with:
tag_prefix: "v"
Expand All @@ -34,13 +30,14 @@ jobs:
minor_pattern: "(MINOR)"

- name: Generate changelog since last tag
uses: mathiasvr/command-output@v1
## NEEDS UPDATE for set-output deprecation.
## See https://github.com/mathiasvr/command-output/issues/4.
id: changelog
with:
run: git log --format="* %s" ${{ steps.get-latest-tag.outputs.tag }}..HEAD | { grep -v "(IGNORE)" || :; }

id: generate-changelog
run: |
{
echo 'changelog<<EOF'
git log --format="* %s" ${{ steps.get-latest-tag.outputs.tag }}..HEAD | { grep -v "(IGNORE)" || :; }
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Log version & changelog
run: |
echo "Version: $VERSION"
Expand All @@ -51,10 +48,10 @@ jobs:
VERSION: ${{ steps.set-version.outputs.version }}
VERSION_TAG: ${{ steps.set-version.outputs.version_tag }}
LATEST_TAG: ${{ steps.get-latest-tag.outputs.tag }}
CHANGELOG: ${{ steps.changelog.outputs.stdout }}
CHANGELOG: ${{ steps.generate-changelog.outputs.changelog }}

- name: Prevent empty release
if: ${{ steps.changelog.outputs.stdout == '' }}
if: ${{ steps.generate-changelog.outputs.changelog == '' }}
uses: actions/github-script@v3
with:
script: |
Expand All @@ -66,12 +63,10 @@ jobs:
mv CHANGELOG.new.md CHANGELOG.md
env:
VERSION: ${{ steps.set-version.outputs.version }}
CHANGELOG: ${{ steps.changelog.outputs.stdout }}
CHANGELOG: ${{ steps.generate-changelog.outputs.changelog }}

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

- name: Bump crate versions
run: |
Expand All @@ -85,8 +80,6 @@ jobs:

- name: Commit Cargo.toml and changelog
uses: stefanzweifel/git-auto-commit-action@v4
## NEEDS UPDATE for set-output deprecation.
## See https://github.com/stefanzweifel/git-auto-commit-action/issues/250.
id: commit
with:
commit_message: Prepare ${{ steps.set-version.outputs.version }} release
Expand All @@ -101,7 +94,7 @@ jobs:
- name: Create release
uses: ncipollo/release-action@v1
with:
body: ${{ steps.changelog.outputs.stdout }}
body: ${{ steps.generate-changelog.outputs.changelog }}
commit: ${{ steps.commit.outputs.commit_hash }}
tag: ${{ steps.set-version.outputs.version_tag }}
token: ${{ secrets.GH_ADMIN_COMMIT_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = ["Eric Scouten <[email protected]>"]
keywords = ["xmp", "metadata"]
categories = ["api-bindings"]
edition = "2021"
rust-version = "1.64.0"
rust-version = "1.66.0"
exclude = [
"external/xmp_toolkit/docs",
"external/xmp_toolkit/samples",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ We welcome contributions to this project. For information on contributing, provi

## Requirements

The toolkit requires **Rust version 1.64.0** or newer. When a newer version of Rust becomes required, a new minor (1.x.0) version of this crate will be released.
The toolkit requires **Rust version 1.66.0** or newer. When a newer version of Rust becomes required, a new minor (1.x.0) version of this crate will be released.

## Crate features

Expand Down

0 comments on commit bd45336

Please sign in to comment.