-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #410 from joshuachp/push-moxzwktoxkkq
chore(forward): port the release v0.9.3
- Loading branch information
Showing
40 changed files
with
1,828 additions
and
358 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This file is part of Astarte. | ||
# | ||
# Copyright 2022-2024 SECO Mind Srl | ||
# Copyright 2022 - 2025 SECO Mind Srl | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
|
@@ -22,13 +22,16 @@ on: | |
workflow_dispatch: | ||
permissions: | ||
contents: read | ||
defaults: | ||
run: | ||
shell: bash | ||
env: | ||
CARGO_TERM_COLOR: always | ||
SCCACHE_GHA_ENABLED: "true" | ||
RUSTC_WRAPPER: "sccache" | ||
jobs: | ||
fmt: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
name: stable / fmt | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -39,14 +42,18 @@ jobs: | |
- name: Check formatting | ||
run: cargo fmt --check --all | ||
clippy: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
name: ${{ matrix.toolchain }} / clippy | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: [stable, beta] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install system dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt-get -y install libsqlite3-dev libssl-dev | ||
- name: Install ${{ matrix.toolchain }} | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
|
@@ -55,40 +62,54 @@ jobs: | |
- name: Install sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
- name: cargo clippy | ||
run: cargo clippy --all-targets --all-features --workspace -- -D warnings | ||
run: cargo clippy --locked --all-targets --all-features --workspace -- -D warnings | ||
doc: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
name: nightly / doc | ||
env: | ||
RUSTDOCFLAGS: -Dwarnings | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install system dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt-get -y install libsqlite3-dev libssl-dev | ||
- name: Install nightly | ||
uses: dtolnay/rust-toolchain@nightly | ||
- name: Install sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
- name: Install cargo-docs-rs | ||
uses: dtolnay/install@cargo-docs-rs | ||
- run: cargo docs-rs | ||
- run: cargo docs-rs --locked | ||
|
||
hack: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
name: ubuntu / stable / features | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install system dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt-get -y install libsqlite3-dev libssl-dev | ||
- name: Install stable | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Install sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
- name: cargo install cargo-hack | ||
uses: taiki-e/install-action@cargo-hack | ||
- name: cargo hack | ||
run: cargo hack --workspace --feature-powerset check | ||
- name: cargo hack test | ||
# Doesn't test all combination of features, but the space is becoming too large and it takes | ||
# too long | ||
run: cargo hack --each-feature test --locked | ||
minimal-versions: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
name: ubuntu / stable / minimal-versions | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install system dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt-get -y install libsqlite3-dev libssl-dev | ||
- name: Install stable | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Install nightly for -Zminimal-versions | ||
|
@@ -106,13 +127,17 @@ jobs: | |
env: | ||
RUSTFLAGS: -D warnings | ||
msrv: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
matrix: | ||
msrv: [1.78.0] | ||
msrv: [1.78] | ||
name: ubuntu / ${{ matrix.msrv }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install system dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt-get -y install libsqlite3-dev libssl-dev | ||
- name: Install ${{ matrix.msrv }} | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
|
@@ -122,12 +147,12 @@ jobs: | |
- name: Install cargo hack | ||
uses: taiki-e/install-action@cargo-hack | ||
- name: cargo +${{ matrix.msrv }} check | ||
run: cargo +1.78.0 hack --no-dev-deps check --workspace --exclude astarte-device-sdk-mock --exclude e2e-test | ||
run: cargo +${{ matrix.msrv }} hack --no-dev-deps check --all-features --exclude astarte-device-sdk-mock --exclude e2e-test | ||
# Run semver-check on release branch push or PR | ||
semver: | ||
if: startsWith(github.base_ref, 'release-') || startsWith(github.ref, 'release-') | ||
name: stable / semver | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install sccache-cache | ||
|
@@ -136,3 +161,18 @@ jobs: | |
uses: obi1kenobi/cargo-semver-checks-action@v2 | ||
with: | ||
release-type: patch | ||
# Check that the create can be compiled with only the packaged files | ||
for-publish: | ||
name: stable / for-publish | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install system dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt-get -y install libsqlite3-dev libssl-dev | ||
- name: Install sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
- name: Install stable | ||
uses: dtolnay/rust-toolchain@stable | ||
- run: ./scripts/check-for-publish.sh |
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
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
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
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,100 @@ | ||
# | ||
# This file is part of Astarte. | ||
# | ||
# Copyright 2025 SECO Mind Srl | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
name: docs | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: | ||
- published | ||
defaults: | ||
run: | ||
shell: bash | ||
permissions: | ||
contents: read | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
latest-release: | ||
runs-on: ubuntu-24.04 | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
CURRENT_RELEASE: ${{ github.event.release.tag_name }} | ||
outputs: | ||
result: ${{ steps.check-release.outputs.RESULT }} | ||
steps: | ||
- name: Check release branch | ||
id: check-release | ||
run: | | ||
latest_release=$(gh release --repo '${{ github.repository }}' list --json='tagName' -q='.[].tagName' | sort --version-sort | tail -n 1) | ||
if [[ "$CURRENT_RELEASE" == "$latest_release" ]]; then | ||
echo "Current branch is the latest release branch" | ||
echo "RESULT=OK" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "Current branch is not the latest release branch" | ||
echo "RESULT=FAILED" >> "$GITHUB_OUTPUT" | ||
fi | ||
push-get-started: | ||
runs-on: ubuntu-24.04 | ||
needs: latest-release | ||
if: needs.latest-release.outputs.RESULT == 'OK' | ||
env: | ||
OUR_FILE: 'docs/get-started.md' | ||
THEIR_FILE: './sdk-doc/source/get_started/rust.md' | ||
steps: | ||
# clone the astarte-device-sdk repo | ||
- uses: actions/checkout@v4 | ||
# clone the sdk-doc repo | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: astarte-platform/sdk-doc | ||
# this also sets up the ssh key for the git push | ||
ssh-key: ${{ secrets.SDK_DOC_DEPLOY_KEY }} | ||
path: sdk-doc | ||
- name: Compare and copy get started | ||
id: cmp-and-copy-get-started | ||
run: | | ||
# remove hidden portion of documentation | ||
file="$(mktemp)" | ||
./scripts/convert-get-started.sh "$OUR_FILE" > $file | ||
# use diff to print to stderr the changes between the files | ||
status="$(diff "$file" "$THEIR_FILE" 1>&2; echo "$?")" | ||
if [[ $status == '0' ]]; then | ||
echo "Get started are identical, no need for update" | ||
exit 0 | ||
elif [[ $status != '1' ]]; then | ||
echo "Troubles" | ||
exit "$status" | ||
fi | ||
echo "Updating get started" | ||
cp -v "$file" "$THEIR_FILE" | ||
cd sdk-doc | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Astarte Bot" | ||
git add "source/get_started/rust.md" | ||
git commit -m "Update Rust SDK get started" | ||
git push |
Oops, something went wrong.