Skip to content

Commit ef500f8

Browse files
0x61nasjonhoodependabot[bot]TudyxWasabi375
authored
ci/github (#4)
* Add one codecov * Merge another codecov * Merge another codecov * Merge another codecov * Merge another codecov * Place codecov config under .github * Add (only) ASAN workflow * Add first coverage workflow * Merge another coverage.yml * Merge another coverage.yml * Add first features workflow * Merge another features workflow * Merge another features workflow * Merge another features workflow * Add (only) loom workflow * Add (only) LSAN workflow * Add first minial workflow * Add (only) miri workflow * Add first msrv workflow * Merge another msrv workflow * Merge another msrv workflow * Merge another msrv workflow * Add (only) no-std workflow * Add first os-check workflow * Merge another os-check workflow * Add first style workflow * Merge another style workflow * Merge another style workflow * Add first test workflow * Merge another test workflow * Merge another test workflow * Merge another test workflow * Make everything use checkout@v3 * Standardize on 'main' as branch name * Missed a submodule checkout * Add TODOs from twitter thread * Practice what you preach * mv github .github This should make it possible to have rust-ci-conf as a remote you merge from. * Merge safety workflows * Catch upcoming deprecations * More concise name for scheduled jobs * Allow examples and binaries to require features * Use dependabot, but only for major versions * ignore is a list * Notify if actions themselves are outdated * Bump codecov/codecov-action from 2 to 3 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2 to 3. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v2...v3) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Move to maintained rust installer See actions-rs/toolchain#216 * Fix install message for msrv * Get rid of most actions-rs bits Given that that project is unmaintained. actions-rs/toolchain#216 * Minimal token permissions See tokio-rs/tokio#5072 * Remove -Zmiri-tag-raw-pointers as it's now default * Unbreak cargo hack for non-libraries (#4) * Add action to run doctest. (#3) `cargo test --all-features` does not run doc-tests. For more information see rust-lang/cargo#6669. * chore: automatically cancel superseded Actions runs (#5) * [sanity] More robust injection of opt-level 1 (#9) Fixes #8 * Quote MSRV version to avoid float parsing (#11) Put 1.70 in there (for instance if you want to pin against OnceLock stabilizing) and it will actually test 1.7 as it appears github auto converts this to a float? Putting in quotes seems to do the right thing here * Install Openssl for Windows (#12) * Don't install OpenSSL on Windows by default * Bump actions/checkout from 3 to 4 (#13) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: Add documentation based on the youtube video (#10) * Nit: Selecting direct minimal versions flag is -Zdirect-minimal-versions (#16) * Add one codecov * Merge another codecov * Merge another codecov * Merge another codecov * Merge another codecov * Place codecov config under .github * Add (only) ASAN workflow * Add first coverage workflow * Merge another coverage.yml * Merge another coverage.yml * Add first features workflow * Merge another features workflow * Merge another features workflow * Merge another features workflow * Add (only) loom workflow * Add (only) LSAN workflow * Add first minial workflow * Add (only) miri workflow * Add first msrv workflow * Merge another msrv workflow * Merge another msrv workflow * Merge another msrv workflow * Add (only) no-std workflow * Add first os-check workflow * Merge another os-check workflow * Add first style workflow * Merge another style workflow * Merge another style workflow * Add first test workflow * Merge another test workflow * Merge another test workflow * Merge another test workflow * Make everything use checkout@v3 * Standardize on 'main' as branch name * Missed a submodule checkout * Add TODOs from twitter thread * Practice what you preach * mv github .github This should make it possible to have rust-ci-conf as a remote you merge from. * Merge safety workflows * Catch upcoming deprecations * More concise name for scheduled jobs * Allow examples and binaries to require features * Use dependabot, but only for major versions * ignore is a list * Notify if actions themselves are outdated * Bump codecov/codecov-action from 2 to 3 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2 to 3. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v2...v3) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Move to maintained rust installer See actions-rs/toolchain#216 * Fix install message for msrv * Get rid of most actions-rs bits Given that that project is unmaintained. actions-rs/toolchain#216 * Minimal token permissions See tokio-rs/tokio#5072 * Remove -Zmiri-tag-raw-pointers as it's now default * Unbreak cargo hack for non-libraries (#4) * Add action to run doctest. (#3) `cargo test --all-features` does not run doc-tests. For more information see rust-lang/cargo#6669. * chore: automatically cancel superseded Actions runs (#5) * [sanity] More robust injection of opt-level 1 (#9) Fixes #8 * Quote MSRV version to avoid float parsing (#11) Put 1.70 in there (for instance if you want to pin against OnceLock stabilizing) and it will actually test 1.7 as it appears github auto converts this to a float? Putting in quotes seems to do the right thing here * Install Openssl for Windows (#12) * Don't install OpenSSL on Windows by default * Bump actions/checkout from 3 to 4 (#13) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: Add documentation based on the youtube video (#10) * Nit: Selecting direct minimal versions flag is -Zdirect-minimal-versions (#16) * chore(github): create the code owners file * chore(github): add the funding methods * chore(github): create the issue templates * chore(github): create the PR template * chore(mergify): create `mergify` config * chore(github): remove the `nostd` workflow * chore(github): remove the `os-check` step and updated the branch name * chore(github): create the CI workflow * chore(github): update the branch name * fix(workflow): disable the loom step for now * fix(minimal-versions): set the minimal versoin of `thiserror` at 1.0.2 * fix(workflow): update the minimal rust version * chore(codespell): create the codespell ignore file * fix(workflow): don't try to build on windows or macos * docs: fix typos * chore(codespell): ignore `crate` * fix(workflow): install X11 * fix(workflow): fix typos * chore(mergify): disable the Dbpndabot rule * chore(github): remove the CI workflow * chore(github): add lint step to the test workflow --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Jon Gjengset <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tudyx <[email protected]> Co-authored-by: Burkhard Mittelbach <[email protected]> Co-authored-by: Simen Bekkhus <[email protected]> Co-authored-by: James Chacon <[email protected]> Co-authored-by: Rod Elias <[email protected]> Co-authored-by: Josh McKinney <[email protected]> Co-authored-by: Mathias Pius <[email protected]>
1 parent 19a6d13 commit ef500f8

21 files changed

+659
-25
lines changed

.codespellignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lqth
2+
Lqth
3+
crate

.github/CODEOWNERS

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# See https://help.github.com/articles/about-codeowners/
2+
# for more info about CODEOWNERS file
3+
4+
# It uses the same pattern rule for gitignore file
5+
# https://git-scm.com/docs/gitignore#_pattern_format
6+
7+
# Core
8+
* @0x61nas

.github/DOCS.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Github config and workflows
2+
3+
In this folder there is configuration for codecoverage, dependabot, and ci
4+
workflows that check the library more deeply than the default configurations.
5+
6+
This folder can be or was merged using a --allow-unrelated-histories merge
7+
strategy from <https://github.com/jonhoo/rust-ci-conf/> which provides a
8+
reasonably sensible base for writing your own ci on. By using this strategy
9+
the history of the CI repo is included in your repo, and future updates to
10+
the CI can be merged later.
11+
12+
To perform this merge run:
13+
14+
```shell
15+
git remote add ci https://github.com/jonhoo/rust-ci-conf.git
16+
git fetch ci
17+
git merge --allow-unrelated-histories ci/main
18+
```
19+
20+
An overview of the files in this project is available at:
21+
<https://www.youtube.com/watch?v=xUH-4y92jPg&t=491s>, which contains some
22+
rationale for decisions and runs through an example of solving minimal version
23+
and OpenSSL issues.

.github/FUNDING.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#github: 0x61nas
2+
custom: ["https://www.buymeacoffee.com/0x61nas"]
3+
ko_fi: 0x61nas

.github/ISSUE_TEMPLATE/bug_report.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Bug report 🐛
3+
about: Report a bug to help us improve
4+
title: ""
5+
labels: "bug"
6+
assignees: "0x61nas"
7+
---
8+
9+
**Describe the bug**
10+
11+
<!--- A clear and concise description of what the bug is. -->
12+
13+
**To reproduce**
14+
15+
<!---
16+
Steps to reproduce the behavior:
17+
1. Build with '...' arguments
18+
2. Run with '....' arguments
19+
4. Use '...' configuration options
20+
5. See error
21+
-->
22+
23+
**Expected behavior**
24+
25+
<!--- A clear and concise description of what you expected to happen. -->
26+
27+
**Screenshots / Logs**
28+
29+
<!--- If applicable, add screenshots to help explain your problem. -->
30+
31+
**Software information**
32+
33+
<!--- Please fill the following fields -->
34+
35+
- Operating system: <!--- e.g. Arch GNU/Linux x86_64 6.2.1-arch1-1 -->
36+
- Rust version: <!--- e.g. rustc 1.69.0-nightly (7281249a1 2023-02-27) -->
37+
- Project version: <!--- e.g. 0.1.0 -->
38+
39+
**Additional context**
40+
41+
<!--- Add any other context about the problem here. -->
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Make a suggestion for the project
4+
title: ""
5+
labels: "enhancement"
6+
assignees: "0x61nas"
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
11+
<!--- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
12+
13+
**Describe the solution you'd like**
14+
15+
<!--- A clear and concise description of what you want to happen. -->
16+
17+
**Describe alternatives you've considered**
18+
19+
<!--- A clear and concise description of any alternative solutions or features you've considered. -->
20+
21+
**Additional context**
22+
23+
<!--- Add any other context or screenshots about the feature request here. -->

.github/PULL_REQUEST_TEMPLATE.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!--- Thank you for contributing to lqth! -->
2+
3+
## Description
4+
5+
<!--- Describe your changes in detail -->
6+
7+
## Motivation and Context
8+
9+
<!--- Why is this change required? What problem does it solve? -->
10+
<!--- If it fixes an open issue, please link to the issue here. -->
11+
12+
## How Has This Been Tested?
13+
14+
<!--- Please describe in detail how you tested your changes. -->
15+
<!--- Include details of your testing environment, and the tests you ran to -->
16+
<!--- see how your change affects other areas of the code, etc. -->
17+
18+
## Screenshots / Logs (if applicable)
19+
20+
## Types of Changes
21+
22+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
23+
24+
- [ ] Bug fix (non-breaking change which fixes an issue)
25+
- [ ] New feature (non-breaking change which adds functionality)
26+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
27+
- [ ] Documentation (no code change)
28+
- [ ] Refactor (refactoring production code)
29+
- [ ] Other <!--- (provide information) -->
30+
31+
## Checklist:
32+
33+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
34+
35+
- [ ] My code follows the code style of this project.
36+
- [ ] I have updated the documentation accordingly.
37+
- [ ] I have formatted the code with [rustfmt](https://github.com/rust-lang/rustfmt).
38+
- [ ] I checked the lints with [clippy](https://github.com/rust-lang/rust-clippy).
39+
- [ ] I have added tests to cover my changes.
40+
- [ ] All new and existing tests passed.

.github/codecov.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# ref: https://docs.codecov.com/docs/codecovyml-reference
2+
coverage:
3+
# Hold ourselves to a high bar
4+
range: 85..100
5+
round: down
6+
precision: 1
7+
status:
8+
# ref: https://docs.codecov.com/docs/commit-status
9+
project:
10+
default:
11+
# Avoid false negatives
12+
threshold: 1%
13+
14+
# Test files aren't important for coverage
15+
ignore:
16+
- "tests"
17+
18+
# Make comments less noisy
19+
comment:
20+
layout: "files"
21+
require_changes: true

.github/dependabot.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily
7+
- package-ecosystem: cargo
8+
directory: /
9+
schedule:
10+
interval: daily
11+
ignore:
12+
- dependency-name: "*"
13+
# patch and minor updates don't matter for libraries as consumers of this library build
14+
# with their own lockfile, rather than the version specified in this library's lockfile
15+
# remove this ignore rule if your package has binaries to ensure that the binaries are
16+
# built with the exact set of dependencies and those are up to date.
17+
update-types:
18+
- "version-update:semver-patch"
19+
- "version-update:semver-minor"

.github/mergify.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
pull_request_rules:
2+
# - name: Automatic merge for Dependabot pull requests
3+
# conditions:
4+
# - "author=dependabot[bot]"
5+
# - "check-success=ci"
6+
# actions:
7+
# merge:
8+
# method: squash
9+
10+
- name: Automatic update to the aurora branch for pull requests
11+
conditions:
12+
- -conflict # skip PRs with conflicts
13+
- -draft # skip GH draft PRs
14+
- -author=dependabot[bot] # skip dependabot PRs
15+
actions:
16+
update:
17+
18+
- name: Automatic merge on approval
19+
conditions:
20+
- "#approved-reviews-by>=1"
21+
actions:
22+
merge:
23+
method: squash

.github/workflows/check.yml

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# This workflow runs whenever a PR is opened or updated, or a commit is pushed to aurora. It runs
2+
# several checks:
3+
# - fmt: checks that the code is formatted according to rustfmt
4+
# - clippy: checks that the code does not contain any clippy warnings
5+
# - doc: checks that the code can be documented without errors
6+
# - hack: check combinations of feature flags
7+
# - msrv: check that the msrv specified in the crate is correct
8+
permissions:
9+
contents: read
10+
# This configuration allows auroratainers of this repo to create a branch and pull request based on
11+
# the new branch. Restricting the push trigger to the aurora branch ensures that the PR only gets
12+
# built once.
13+
on:
14+
push:
15+
branches: [aurora]
16+
pull_request:
17+
# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
18+
# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
name: check
23+
jobs:
24+
fmt:
25+
runs-on: ubuntu-latest
26+
name: stable / fmt
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
submodules: true
31+
- name: Install stable
32+
uses: dtolnay/rust-toolchain@stable
33+
with:
34+
components: rustfmt
35+
- name: cargo fmt --check
36+
run: cargo fmt --check
37+
clippy:
38+
runs-on: ubuntu-latest
39+
name: ${{ matrix.toolchain }} / clippy
40+
permissions:
41+
contents: read
42+
checks: write
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
# Get early warning of new lints which are regularly introduced in beta channels.
47+
toolchain: [stable, beta]
48+
steps:
49+
- uses: actions/checkout@v4
50+
with:
51+
submodules: true
52+
- name: Install ${{ matrix.toolchain }}
53+
uses: dtolnay/rust-toolchain@master
54+
with:
55+
toolchain: ${{ matrix.toolchain }}
56+
components: clippy
57+
- name: cargo clippy
58+
uses: actions-rs/clippy-check@v1
59+
with:
60+
token: ${{ secrets.GITHUB_TOKEN }}
61+
doc:
62+
# run docs generation on nightly rather than stable. This enables features like
63+
# https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html which allows an
64+
# API be documented as only available in some specific platforms.
65+
runs-on: ubuntu-latest
66+
name: nightly / doc
67+
steps:
68+
- uses: actions/checkout@v4
69+
with:
70+
submodules: true
71+
- name: Install nightly
72+
uses: dtolnay/rust-toolchain@nightly
73+
- name: cargo doc
74+
run: cargo doc --no-deps --all-features
75+
env:
76+
RUSTDOCFLAGS: --cfg docsrs
77+
hack:
78+
# cargo-hack checks combinations of feature flags to ensure that features are all additive
79+
# which is required for feature unification
80+
runs-on: ubuntu-latest
81+
name: ubuntu / stable / features
82+
steps:
83+
- uses: actions/checkout@v4
84+
with:
85+
submodules: true
86+
- name: Install stable
87+
uses: dtolnay/rust-toolchain@stable
88+
- name: cargo install cargo-hack
89+
uses: taiki-e/install-action@cargo-hack
90+
# intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4
91+
# --feature-powerset runs for every combination of features
92+
- name: cargo hack
93+
run: cargo hack --feature-powerset check
94+
msrv:
95+
# check that we can build using the minimal rust version that is specified by this crate
96+
runs-on: ubuntu-latest
97+
# we use a matrix here just because env can't be used in job names
98+
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
99+
strategy:
100+
matrix:
101+
msrv: ["1.65.0"] # 2021 edition requires 1.56
102+
name: ubuntu / ${{ matrix.msrv }}
103+
steps:
104+
- uses: actions/checkout@v4
105+
with:
106+
submodules: true
107+
- name: Install ${{ matrix.msrv }}
108+
uses: dtolnay/rust-toolchain@master
109+
with:
110+
toolchain: ${{ matrix.msrv }}
111+
- name: cargo +${{ matrix.msrv }} check
112+
run: cargo check
113+
114+
lint:
115+
name: Lint
116+
runs-on: ubuntu-latest
117+
steps:
118+
- name: Checkout the repository
119+
if: github.event_name != 'pull_request'
120+
uses: actions/checkout@v4
121+
- name: Checkout the repository
122+
if: github.event_name == 'pull_request'
123+
uses: actions/checkout@v4
124+
with:
125+
ref: ${{ github.event.pull_request.head.sha }}
126+
127+
- name: Install Rust
128+
uses: actions-rs/toolchain@v1
129+
with:
130+
profile: minimal
131+
toolchain: stable
132+
override: true
133+
components: rustfmt, clippy
134+
135+
- name: Cache Cargo dependencies
136+
uses: Swatinem/rust-cache@v2
137+
138+
- name: Run cargo-deny
139+
uses: EmbarkStudios/cargo-deny-action@v1
140+
with:
141+
command: check licenses sources
142+
143+
- name: Run cargo-audit
144+
uses: actions-rs/audit-check@v1
145+
with:
146+
token: ${{ secrets.GITHUB_TOKEN }}
147+
148+
- name: Run committed
149+
uses: crate-ci/committed@master
150+
with:
151+
args: "-vv"
152+
commits: "HEAD"
153+
154+
- name: Run lychee
155+
uses: lycheeverse/lychee-action@v1
156+
with:
157+
args: -v *.md
158+
env:
159+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
160+
161+
- name: Run codespell
162+
uses: codespell-project/actions-codespell@master
163+
with:
164+
check_filenames: true
165+
check_hidden: true
166+
ignore_words_file: .codespellignore
167+
skip: target,.git,_typos.toml

0 commit comments

Comments
 (0)