Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci/github #51

Merged
merged 79 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
1c486b2
Add one codecov
jonhoo Sep 17, 2022
1b8c305
Merge another codecov
jonhoo Sep 17, 2022
7f34f79
Merge another codecov
jonhoo Sep 17, 2022
510b696
Merge another codecov
jonhoo Sep 17, 2022
b32648c
Merge another codecov
jonhoo Sep 17, 2022
126c9a3
Place codecov config under .github
jonhoo Sep 17, 2022
11027d3
Add (only) ASAN workflow
jonhoo Sep 17, 2022
bbdbd96
Add first coverage workflow
jonhoo Sep 17, 2022
fe6ba38
Merge another coverage.yml
jonhoo Sep 17, 2022
1fe2a6d
Merge another coverage.yml
jonhoo Sep 17, 2022
225ad39
Add first features workflow
jonhoo Sep 17, 2022
922692a
Merge another features workflow
jonhoo Sep 17, 2022
043eb24
Merge another features workflow
jonhoo Sep 17, 2022
d8c8a99
Merge another features workflow
jonhoo Sep 17, 2022
f67cad0
Add (only) loom workflow
jonhoo Sep 17, 2022
bf66d94
Add (only) LSAN workflow
jonhoo Sep 17, 2022
c65a7c4
Add first minial workflow
jonhoo Sep 17, 2022
77079d7
Add (only) miri workflow
jonhoo Sep 17, 2022
9b48ae3
Add first msrv workflow
jonhoo Sep 17, 2022
b60aa55
Merge another msrv workflow
jonhoo Sep 17, 2022
1113c89
Merge another msrv workflow
jonhoo Sep 17, 2022
e6ef8e3
Merge another msrv workflow
jonhoo Sep 17, 2022
c74ee96
Add (only) no-std workflow
jonhoo Sep 17, 2022
92379c8
Add first os-check workflow
jonhoo Sep 17, 2022
05dd468
Merge another os-check workflow
jonhoo Sep 17, 2022
bc3f551
Add first style workflow
jonhoo Sep 17, 2022
fe46040
Merge another style workflow
jonhoo Sep 17, 2022
3bd8b12
Merge another style workflow
jonhoo Sep 17, 2022
8953a88
Add first test workflow
jonhoo Sep 17, 2022
0910d97
Merge another test workflow
jonhoo Sep 17, 2022
971c3fd
Merge another test workflow
jonhoo Sep 17, 2022
2de2235
Merge another test workflow
jonhoo Sep 17, 2022
0f90a0b
Make everything use checkout@v3
jonhoo Sep 17, 2022
99ddee8
Standardize on 'main' as branch name
jonhoo Sep 17, 2022
8736566
Missed a submodule checkout
jonhoo Sep 17, 2022
4859c12
Add TODOs from twitter thread
jonhoo Sep 18, 2022
afa2531
Practice what you preach
jonhoo Sep 18, 2022
71c2048
mv github .github
jonhoo Sep 18, 2022
56d4398
Merge safety workflows
jonhoo Sep 18, 2022
15c1fa2
Catch upcoming deprecations
jonhoo Sep 18, 2022
ea198cc
More concise name for scheduled jobs
jonhoo Sep 18, 2022
441dc27
Allow examples and binaries to require features
jonhoo Sep 18, 2022
b783cb3
Use dependabot, but only for major versions
jonhoo Sep 23, 2022
cf47d4c
ignore is a list
jonhoo Sep 29, 2022
82cbed8
Notify if actions themselves are outdated
jonhoo Dec 10, 2022
c8a7835
Bump codecov/codecov-action from 2 to 3
dependabot[bot] Dec 10, 2022
d6bd5c6
Merge pull request #1 from jonhoo/dependabot/github_actions/codecov/c…
jonhoo Dec 10, 2022
362696a
Move to maintained rust installer
jonhoo Mar 11, 2023
90999e1
Fix install message for msrv
jonhoo Mar 11, 2023
9afb0e1
Get rid of most actions-rs bits
jonhoo Mar 11, 2023
a076ec1
Minimal token permissions
jonhoo Mar 11, 2023
5ea5935
Remove -Zmiri-tag-raw-pointers as it's now default
jonhoo Mar 12, 2023
0d12c82
Unbreak cargo hack for non-libraries (#4)
Tudyx Mar 20, 2023
80a8919
Add action to run doctest. (#3)
Wasabi375 Mar 20, 2023
16a2c29
chore: automatically cancel superseded Actions runs (#5)
SimenB Apr 8, 2023
6332a3a
[sanity] More robust injection of opt-level 1 (#9)
jonhoo Apr 24, 2023
99f108f
Quote MSRV version to avoid float parsing (#11)
jmchacon Aug 13, 2023
c704bcc
Install Openssl for Windows (#12)
chapeupreto Aug 20, 2023
7c327dd
Don't install OpenSSL on Windows by default
jonhoo Aug 20, 2023
deb9fd3
Bump actions/checkout from 3 to 4 (#13)
dependabot[bot] Sep 9, 2023
bfee117
docs: Add documentation based on the youtube video (#10)
joshka Nov 11, 2023
3d6ab95
Nit: Selecting direct minimal versions flag is -Zdirect-minimal-versi…
MathiasPius Nov 11, 2023
60fdfbb
chore: fix typos (#17)
0x61nas Dec 17, 2023
a136915
Remove stray trailing whitespace
jonhoo Dec 17, 2023
f505e09
replace actions-rs/clippy-check with giraffate/clippy-action (#19)
rtkay123 Jan 20, 2024
59dcd2c
Merge remote-tracking branch 'ci/main' into ci/github
0x61nas Jan 29, 2024
8b2545d
ci(check): update the branch name and chang the msrv to 1.65
0x61nas Jan 29, 2024
e92f434
ci(nostd): rm nostd.yml
0x61nas Jan 29, 2024
28962da
ci(safety): update the branch name
0x61nas Jan 29, 2024
ad1374d
ci(schedule): change the branch name
0x61nas Jan 29, 2024
174577d
ci(test): change the branch name
0x61nas Jan 29, 2024
38dbf2a
clean: rm DOCS.md
0x61nas Jan 29, 2024
73259f7
chore(github): codeowners create
0x61nas Jan 29, 2024
5c976e2
chore(github): create a pull reqest template
0x61nas Jan 29, 2024
0a73ebd
chore(github): put useless funding stuff
0x61nas Jan 29, 2024
47e34e4
chore(mergify): create `mergify` config
0x61nas Jan 29, 2024
3b80d8a
chore(github): create issues templates
0x61nas Jan 29, 2024
7fda102
fix(mergify): remove the conflicted config
0x61nas Jan 29, 2024
93aaace
ci(safety): remove loom job
0x61nas Jan 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See https://help.github.com/articles/about-codeowners/
# for more info about CODEOWNERS file

# It uses the same pattern rule for gitignore file
# https://git-scm.com/docs/gitignore#_pattern_format

# Core
* @0x61nas
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#github: 0x61nas
custom: ["https://www.buymeacoffee.com/0x61nas"]
ko_fi: 0x61nas
liberapay: 0x61nas
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug report 🐛
about: Report a bug to help us improve
title: ""
labels: "bug"
assignees: "0x61nas"
---

**Describe the bug**

<!--- A clear and concise description of what the bug is. -->

**To reproduce**

<!---
Steps to reproduce the behavior:
1. Build with '...' arguments
2. Run with '....' arguments
4. Use '...' configuration options
5. See error
-->

**Expected behavior**

<!--- A clear and concise description of what you expected to happen. -->

**Screenshots / Logs**

<!--- If applicable, add screenshots to help explain your problem. -->

**Software information**

<!--- Please fill the following fields -->

- Operating system: <!--- e.g. Arch GNU/Linux x86_64 6.2.1-arch1-1 -->
- Rust version: <!--- e.g. rustc 1.69.0-nightly (7281249a1 2023-02-27) -->
- Project version: <!--- e.g. 0.1.0 -->

**Additional context**

<!--- Add any other context about the problem here. -->
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Make a suggestion for the project
title: ""
labels: "enhancement"
assignees: "0x61nas"
---

**Is your feature request related to a problem? Please describe.**

<!--- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Describe the solution you'd like**

<!--- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered**

<!--- A clear and concise description of any alternative solutions or features you've considered. -->

**Additional context**

<!--- Add any other context or screenshots about the feature request here. -->
40 changes: 40 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!--- Thank you for contributing to aarty! -->

## Description

<!--- Describe your changes in detail -->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots / Logs (if applicable)

## Types of Changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation (no code change)
- [ ] Refactor (refactoring production code)
- [ ] Other <!--- (provide information) -->

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->

- [ ] My code follows the code style of this project.
- [ ] I have updated the documentation accordingly.
- [ ] I have formatted the code with [rustfmt](https://github.com/rust-lang/rustfmt).
- [ ] I checked the lints with [clippy](https://github.com/rust-lang/rust-clippy).
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
21 changes: 21 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ref: https://docs.codecov.com/docs/codecovyml-reference
coverage:
# Hold ourselves to a high bar
range: 85..100
round: down
precision: 1
status:
# ref: https://docs.codecov.com/docs/commit-status
project:
default:
# Avoid false negatives
threshold: 1%

# Test files aren't important for coverage
ignore:
- "tests"

# Make comments less noisy
comment:
layout: "files"
require_changes: true
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
- package-ecosystem: cargo
directory: /
schedule:
interval: daily
ignore:
- dependency-name: "*"
# patch and minor updates don't matter for libraries as consumers of this library build
# with their own lockfile, rather than the version specified in this library's lockfile
# remove this ignore rule if your package has binaries to ensure that the binaries are
# built with the exact set of dependencies and those are up to date.
update-types:
- "version-update:semver-patch"
- "version-update:semver-minor"
23 changes: 23 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
pull_request_rules:
# - name: Automatic merge for Dependabot pull requests
# conditions:
# - "author=dependabot[bot]"
# - "check-success=ci"
# actions:
# merge:
# method: squash

- name: Automatic update to the aurora branch for pull requests
conditions:
- -conflict # skip PRs with conflicts
- -draft # skip GH draft PRs
- -author=dependabot[bot] # skip dependabot PRs
actions:
update:

- name: Automatic merge on approval
conditions:
- "#approved-reviews-by>=1"
actions:
merge:
method: squash
113 changes: 113 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# This workflow runs whenever a PR is opened or updated, or a commit is pushed to main. It runs
# several checks:
# - fmt: checks that the code is formatted according to rustfmt
# - clippy: checks that the code does not contain any clippy warnings
# - doc: checks that the code can be documented without errors
# - hack: check combinations of feature flags
# - msrv: check that the msrv specified in the crate is correct
permissions:
contents: read
# This configuration allows maintainers of this repo to create a branch and pull request based on
# the new branch. Restricting the push trigger to the main branch ensures that the PR only gets
# built once.
on:
push:
branches: [aurora]
pull_request:
# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: check
jobs:
fmt:
runs-on: ubuntu-latest
name: stable / fmt
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: cargo fmt --check
run: cargo fmt --check
clippy:
runs-on: ubuntu-latest
name: ${{ matrix.toolchain }} / clippy
permissions:
contents: read
checks: write
strategy:
fail-fast: false
matrix:
# Get early warning of new lints which are regularly introduced in beta channels.
toolchain: [stable, beta]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- name: cargo clippy
uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-check'
github_token: ${{ secrets.GITHUB_TOKEN }}
doc:
# run docs generation on nightly rather than stable. This enables features like
# https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html which allows an
# API be documented as only available in some specific platforms.
runs-on: ubuntu-latest
name: nightly / doc
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install nightly
uses: dtolnay/rust-toolchain@nightly
- name: cargo doc
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: --cfg docsrs
hack:
# cargo-hack checks combinations of feature flags to ensure that features are all additive
# which is required for feature unification
runs-on: ubuntu-latest
name: ubuntu / stable / features
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo install cargo-hack
uses: taiki-e/install-action@cargo-hack
# intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4
# --feature-powerset runs for every combination of features
- name: cargo hack
run: cargo hack --feature-powerset check
msrv:
# check that we can build using the minimal rust version that is specified by this crate
runs-on: ubuntu-latest
# we use a matrix here just because env can't be used in job names
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
strategy:
matrix:
msrv: ["1.65"]
name: ubuntu / ${{ matrix.msrv }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install ${{ matrix.msrv }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.msrv }}
- name: cargo +${{ matrix.msrv }} check
run: cargo check
70 changes: 70 additions & 0 deletions .github/workflows/safety.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This workflow runs checks for unsafe code. In crates that don't have any unsafe code, this can be
# removed. Runs:
# - miri - detects undefined behavior and memory leaks
# - address sanitizer - detects memory errors
# - leak sanitizer - detects memory leaks
# See check.yml for information about how the concurrency cancellation and workflow triggering works
permissions:
contents: read
on:
push:
branches: [aurora]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: safety
jobs:
sanitizers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install nightly
uses: dtolnay/rust-toolchain@nightly
- run: |
# to get the symbolizer for debug symbol resolution
sudo apt install llvm
# to fix buggy leak analyzer:
# https://github.com/japaric/rust-san#unrealiable-leaksanitizer
# ensure there's a profile.dev section
if ! grep -qE '^[ \t]*[profile.dev]' Cargo.toml; then
echo >> Cargo.toml
echo '[profile.dev]' >> Cargo.toml
fi
# remove pre-existing opt-levels in profile.dev
sed -i '/^\s*\[profile.dev\]/,/^\s*\[/ {/^\s*opt-level/d}' Cargo.toml
# now set opt-level to 1
sed -i '/^\s*\[profile.dev\]/a opt-level = 1' Cargo.toml
cat Cargo.toml
name: Enable debug symbols
- name: cargo test -Zsanitizer=address
# only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945
run: cargo test --lib --tests --all-features --target x86_64-unknown-linux-gnu
env:
ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0"
RUSTFLAGS: "-Z sanitizer=address"
- name: cargo test -Zsanitizer=leak
if: always()
run: cargo test --all-features --target x86_64-unknown-linux-gnu
env:
LSAN_OPTIONS: "suppressions=lsan-suppressions.txt"
RUSTFLAGS: "-Z sanitizer=leak"
miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: |
echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV
- name: Install ${{ env.NIGHTLY }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.NIGHTLY }}
components: miri
- name: cargo miri test
run: cargo miri test
env:
MIRIFLAGS: ""
Loading
Loading