-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9dfbc57
commit b8635b2
Showing
1 changed file
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
name: Nightly build | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 5 * * *" # 0500 UTC every day | ||
|
||
jobs: | ||
# Create snapshot of main branch for nightly build | ||
nightly-snapshot: | ||
name: Create snapshot | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GH_ADMIN_COMMIT_TOKEN }} | ||
|
||
- name: Set new proposed version | ||
uses: paulhatch/semantic-version@v5.4.0 | ||
id: set-version | ||
with: | ||
tag_prefix: "v" | ||
version_format: "${major}.${minor}.${patch}" | ||
major_pattern: "(MAJOR)" | ||
minor_pattern: "(MINOR)" | ||
|
||
- name: Add -nightly+(date)-(commit ID) prefix to version | ||
id: set-nightly-version | ||
run: | | ||
echo version=${{ steps.set-version.outputs.version }}-nightly+`date +%F`-`git rev-parse --short HEAD` >> "$GITHUB_OUTPUT" | ||
- name: Log new version & changelog | ||
run: | | ||
echo "Proposed new version: $VERSION" | ||
echo "Nightly version: $NIGHTLY_VERSION" | ||
env: | ||
VERSION: ${{ steps.set-version.outputs.version }} | ||
NIGHTLY_VERSION: ${{ steps.set-nightly-version.outputs.version }} | ||
|
||
- name: Bump crate versions | ||
run: | | ||
sed -i "s/^version = \"[^\"]*\"$/version = \"$VERSION\"/;" sdk/Cargo.toml | ||
env: | ||
VERSION: ${{ steps.set-nightly-version.outputs.version }} | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: cargo | ||
|
||
- name: Create or update Cargo.lock | ||
run: | | ||
cargo update -w | ||
git add -f Cargo.lock | ||
- name: Report differences for "prepare (release)" commit | ||
run: git diff | ||
|
||
- name: Commit Cargo.toml and Cargo.lock | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
id: commit | ||
with: | ||
branch: nightly | ||
push_options: '--force' | ||
commit_message: Prepare ${{ steps.set-nightly-version.outputs.version }} release | ||
commit_user_name: Adobe CAI Team | ||
commit_user_email: noreply@adobe.com | ||
create_branch: true | ||
|
||
tests: | ||
name: Unit tests | ||
runs-on: ${{ matrix.os }} | ||
needs: nightly-snapshot | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-latest] | ||
|
||
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 unit tests (cross build) | ||
run: cargo test --all-targets --all-features | ||
|
||
test-direct-minimal-versions: | ||
name: Unit tests with minimum versions of direct dependencies | ||
runs-on: ${{ matrix.os }} | ||
needs: nightly-snapshot | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-latest] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: nightly | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@nightly | ||
|
||
- name: Cache Rust dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Run tests | ||
run: cargo +nightly test -Z direct-minimal-versions --all-targets --all-features |