-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
139 additions
and
43 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
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,44 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
name: Test coverage | ||
|
||
jobs: | ||
coverage: | ||
name: Collect test coverage | ||
runs-on: ubuntu-latest | ||
# nightly rust might break from time to time | ||
continue-on-error: true | ||
env: | ||
RUSTFLAGS: -D warnings | ||
CARGO_TERM_COLOR: always | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
# Nightly Rust is used for cargo llvm-cov --doc below. | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: llvm-tools-preview | ||
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2 | ||
|
||
- name: Install latest nextest release | ||
uses: taiki-e/install-action@nextest | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
|
||
- name: Collect coverage data | ||
# Generate separate reports for nextest and doctests, and combine them. | ||
run: | | ||
cargo llvm-cov --no-report nextest | ||
cargo llvm-cov --no-report --doc | ||
cargo llvm-cov report --doctests --lcov --output-path lcov.info | ||
- name: Upload coverage data to codecov | ||
uses: codecov/codecov-action@c16abc29c95fcf9174b58eb7e1abf4c866893bc8 # v4 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
files: lcov.info |
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 |
---|---|---|
@@ -1,32 +1,33 @@ | ||
# adapted from https://github.com/taiki-e/cargo-hack/blob/main/.github/workflows/release.yml | ||
|
||
name: Publish release | ||
name: Publish releases to GitHub | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
- "*" | ||
|
||
jobs: | ||
create-release: | ||
if: github.repository_owner == 'nextest-rs' | ||
datatest-stable-release: | ||
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'datatest-stable-') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
with: | ||
persist-credentials: false | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1 | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Install cargo release | ||
uses: taiki-e/install-action@834a7b93e0c678fb40309ee0e36546336d5c6ea7 # v2 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- run: cargo publish | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
tool: [email protected] | ||
- uses: taiki-e/create-gh-release-action@8df4de6534ceacdaed10a08f73418ca751f31793 # v1 | ||
with: | ||
prefix: datatest-stable | ||
changelog: CHANGELOG.md | ||
title: datatest-stable $version | ||
title: $prefix $version | ||
branch: main | ||
prefix: datatest-stable | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- run: ./scripts/cargo-release-publish.sh | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
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,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Build docs for all crates and direct dependencies. The gawk script turns e.g. "quick-junit v0.1.0" | ||
# into "[email protected]". | ||
cargo tree --depth 1 -e normal --prefix none \ | ||
| gawk '{ gsub(" v", "@", $0); printf("%s\n", $1); }' \ | ||
| xargs printf -- '-p %s\n' \ | ||
| xargs cargo doc --no-deps --lib | ||
|
||
# Also drop a _redirects file in the root of the docs directory -- this will be picked up by the | ||
# CI script. | ||
echo "/ /rustdoc/datatest_stable/ 301" > target/doc/_redirects |
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,16 @@ | ||
#!/bin/bash | ||
|
||
# Use cargo-release to publish crates to crates.io. | ||
|
||
set -xe -o pipefail | ||
|
||
# cargo-release requires a release off a branch (maybe it shouldn't?) | ||
# Check out this branch, creating it if it doesn't exist. | ||
git checkout -B to-release | ||
|
||
# --execute: actually does the release | ||
# --no-confirm: don't ask for confirmation, since this is a non-interactive script | ||
cargo release publish --publish --execute --no-confirm --workspace "$@" | ||
|
||
git checkout - | ||
git branch -D to-release |