-
Notifications
You must be signed in to change notification settings - Fork 6
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
2081c27
commit 7a2b647
Showing
18 changed files
with
1,152 additions
and
15 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,39 @@ | ||
# Copyright (c) 2024 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Apache License Version 2.0 which is available at | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# This is the configuration used by GitHub for automatically creating release notes | ||
# from pull requests based on their labels | ||
# see https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes | ||
|
||
changelog: | ||
exclude: | ||
labels: | ||
- duplicate | ||
- wontfix | ||
- invalid | ||
authors: | ||
- octocat | ||
categories: | ||
- title: "🛠️ Breaking Changes" | ||
labels: | ||
- "breaking change" | ||
- title: "✨ Features" | ||
labels: | ||
- enhancement | ||
- title: "🐛 Bug Fixes" | ||
labels: | ||
- bug | ||
- title: "📚 Documentation" | ||
labels: | ||
- documentation | ||
- title: "Other Changes" | ||
labels: | ||
- "*" |
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,38 @@ | ||
# Which automations do we run? | ||
|
||
This file is meant to provide an overview and explainer on what the up-subscription-rust workflow automation strategy is, and what the different workflow elements do. | ||
|
||
__A general note:__ All workflows will use the `stable` version of the Rust toolchain, unless the GitHub actions variable `RUST_TOOLCHAIN` is set to pin a specific Rust version (e.g. ```RUST_TOOLCHAIN=1.76.0```). | ||
|
||
At this time, there are three events that will initiate a workflow run: | ||
|
||
## PRs and merges to main | ||
|
||
We want a comprehensive but also quick check&test workflow. This should be testing all relevant/obvious feature sets, run on all major OSes, and of course include all the Rust goodness around cargo check, fmt, clippy and so on. | ||
|
||
This is implemented in [`check.yaml`](check.yaml) | ||
|
||
## Release publication | ||
|
||
We want exhaustive tests and all possible checks, as well as creation of license reports, collection of quality artifacts and publication to crates.io. This workflow pulls in other pieces like the build workflow. An actual release is triggered by pushing a tag that begins with 'v', else this workflow just generates and collects artifacts on workflow level. This will also publish to crates.io if the CRATES_TOKEN secret is set. | ||
|
||
This is implemented in [`release.yaml`](release.yaml) | ||
|
||
## Nightly, out of everyone's way | ||
|
||
All the tests we can think of, however long they might take. For instance, we can build up-subscription-rust for different architectures - this might not really create many insights, but doesn't hurt to try either, and fits nicely into a nightly build schedule. | ||
|
||
This is implemented in [`nightly.yaml`](nightly.yaml) | ||
|
||
## Further workflow modules | ||
|
||
In addition to the main workflows described above, there exist a number of modules that are used by these main workflows. They can also be run standalone, and are intendet to make composing the capabilities of our main workflows simpler. These are: | ||
|
||
- `verify-msrv.yaml` - checks if the MSRV ('Minimum Supported Rust Version) declared in Cargo.toml is correct | ||
- `coverage.yaml` - collects test code coverage, and can optionally upload the results to codecov.io | ||
- Will publish coverage data to CodeCov if `${{ secrets.CODECOV_TOKEN }}` is set | ||
- outputs: download URL for the workflow-generated coverage info file | ||
- `license-report.yaml` - create a license report for `up-rust` and all its dependencies in html format | ||
- outputs: download URL for the workflow-generated license report | ||
- `test-featurematrix.yaml` - Test all feature combinations on a range of OS platforms | ||
- `x-build.yaml` - Run release builds on multiple architecture targets |
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,180 @@ | ||
# ******************************************************************************** | ||
# Copyright (c) 2024 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Apache License Version 2.0 which is available at | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# *******************************************************************************/ | ||
|
||
# Comprehensive combination of checks, linting, feature-checks, testing to be run on merge and on PR | ||
# Upload test results for potential re-use in publication workflow, returns the corresponding download URL as an output on workflow_call | ||
|
||
name: Cargo | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- "src/**" | ||
- "Cargo.*" | ||
- "deny.toml" | ||
workflow_call: | ||
inputs: | ||
package: | ||
description: "Which rust package to check" | ||
required: false | ||
default: '"*"' # for some reason, this default is ignored, so we have to repeat the pattern below | ||
type: string | ||
outputs: | ||
test_results_url: | ||
description: "URL of the test results artifact" | ||
value: ${{ jobs.nextest.outputs.test_results_url }} | ||
doctest_results_url: | ||
description: "URL of the doctest results artifact" | ||
value: ${{ jobs.doctest.outputs.test_results_url }} | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
RUST_TOOLCHAIN: ${{ vars.RUST_TOOLCHAIN || 'stable' }} | ||
RUSTFLAGS: -Dwarnings | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
deny: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
- uses: taiki-e/install-action@cargo-deny | ||
- name: Run cargo deny check | ||
run: | | ||
cargo deny check | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
- name: Run cargo check | ||
run: | | ||
cargo check --package ${{ inputs.package || '"*"' }} --all --tests | ||
fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
components: rustfmt | ||
- name: Run cargo fmt | ||
run: | | ||
cargo fmt --package ${{ inputs.package || '"*"' }} --all -- --check | ||
clippy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
components: clippy | ||
- name: Run cargo clippy | ||
run: | | ||
cargo clippy --version | ||
cargo clippy --tests --examples | ||
docu: | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTDOCFLAGS: -Dwarnings | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
- name: Run rustdoc | ||
run: | | ||
cargo doc --package ${{ inputs.package || '"*"' }} --no-deps --all-features | ||
feature-check: | ||
# Comprehensive check on dependencies for all feature flag combinations, excluding development dependencies | ||
needs: check | ||
# do not run for package 'up-subscription' - the cargo hack module does not properly support --package="*" at the moment, so different approach than the other instances | ||
if: inputs.package != 'up-subscription' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: taiki-e/install-action@cargo-hack | ||
- name: Run cargo hack powerset | ||
run: | | ||
cargo hack check --feature-powerset --no-dev-deps | ||
nextest: | ||
# Subset of feature-combos, on only one OS - more complete testing in test-featurematrix.yaml | ||
outputs: | ||
test_results_url: ${{ steps.test_results.outputs.artifact-url }} | ||
runs-on: ubuntu-latest | ||
env: | ||
NEXTEST_EXPERIMENTAL_LIBTEST_JSON: 1 | ||
strategy: | ||
matrix: | ||
feature-flags: ["", "--no-default-features", "--all-features"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
- uses: Swatinem/rust-cache@v2 | ||
# Using nextest because it's faster than built-in test | ||
- uses: taiki-e/install-action@nextest | ||
- name: Run cargo nextest | ||
run: | | ||
cargo nextest run --package ${{ inputs.package || '"*"' }} --message-format libtest-json-plus ${{ matrix.feature-flags }} > testresults${{ matrix.feature-flags }}.json | ||
- name: Upload all-features test results artifact | ||
id: test_results | ||
if: matrix.feature-flags == '--all-features' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-results | ||
path: testresults--all-features.json | ||
|
||
doctest: | ||
# Run doctests separately, as nextest doesn't yet (https://github.com/nextest-rs/nextest/issues/16) | ||
outputs: | ||
test_results_url: ${{ steps.doctest_results.outputs.artifact-url }} | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTDOCFLAGS: -Dwarnings | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
- name: Run doc tests | ||
run: | | ||
RUSTC_BOOTSTRAP=1 cargo test --package ${{ inputs.package || '"*"' }} --doc --all-features -- -Z unstable-options --format json --report-time > doctestresults--all-features.json | ||
- name: Upload doctest results artifact | ||
id: doctest_results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: doctest-results | ||
path: doctestresults--all-features.json |
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,86 @@ | ||
# ******************************************************************************** | ||
# Copyright (c) 2024 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Apache License Version 2.0 which is available at | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# *******************************************************************************/ | ||
|
||
# Run all test for all features to collect test code coverage information | ||
# Upload coverage info for potential re-use in publication workflow, returns the corresponding download URL as an output on workflow_call | ||
# Can publish coverage info to CodeCov platform, this is controlled by setting CODECOV_TOKEN secret in the github workspace | ||
|
||
name: Test coverage | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
package: | ||
description: "Which rust package to check" | ||
required: false | ||
default: '"*"' # for some reason, this default is ignored, so we have to repeat the pattern below | ||
type: string | ||
outputs: | ||
test_coverage_url: | ||
description: 'URL of the test coverage artifact' | ||
value: ${{ jobs.coverage.outputs.test_coverage_url }} | ||
workflow_dispatch: | ||
|
||
env: | ||
RUST_TOOLCHAIN: ${{ vars.RUST_TOOLCHAIN || 'stable' }} | ||
RUSTFLAGS: -Dwarnings | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
coverage: | ||
name: collect | ||
runs-on: ubuntu-latest | ||
outputs: | ||
test_coverage_url: ${{ steps.test_coverage_html.outputs.artifact-url }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
- name: Install cargo-tarpaulin | ||
uses: taiki-e/install-action@cargo-tarpaulin | ||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Run tests and report code coverage | ||
run: | | ||
# enable nightly features so that we can also include Doctests | ||
RUSTC_BOOTSTRAP=1 cargo tarpaulin --package ${{ inputs.package || '"*"' }} -o xml -o lcov -o html --doc --tests | ||
- name: Upload coverage report (lcov) | ||
uses: actions/upload-artifact@v4 | ||
id: test_coverage_lcov | ||
with: | ||
name: code-coverage-lcov | ||
path: lcov.info | ||
- name: Upload coverage report (xml) | ||
uses: actions/upload-artifact@v4 | ||
id: test_coverage_xml | ||
with: | ||
name: code-coverage-xml | ||
path: cobertura.xml | ||
- name: Upload coverage report (html) | ||
uses: actions/upload-artifact@v4 | ||
id: test_coverage_html | ||
with: | ||
name: code-coverage-html | ||
path: tarpaulin-report.html | ||
|
||
- name: Upload coverage reports to Codecov | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
if: env.CODECOV_TOKEN != '' | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: ${{ vars.GITHUB_REPOSITORY }} | ||
files: lcov.info |
Oops, something went wrong.