Skip to content

Commit 1acc69e

Browse files
authored
Merge pull request #1 from rust-random/push-okrqnvszorqq
Add CI and .gitignore
2 parents 1eb4c87 + 04f9ed2 commit 1acc69e

File tree

11 files changed

+280
-1
lines changed

11 files changed

+280
-1
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: dhardy
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Bug report
3+
about: Something doesn't work as expected
4+
title: ''
5+
labels: X-bug
6+
assignees: ''
7+
8+
---
9+
10+
## Summary
11+
12+
A clear and concise description of what the bug is.
13+
14+
What behaviour is expected, and why?
15+
16+
## Code sample
17+
18+
```rust
19+
// Code demonstrating the problem
20+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Compile issue
3+
about: Report / ask about a compilation issue
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
# Common issues
11+
12+
**Problem**: `rand_hc::Hc128Rng: rand_core::SeedableRng` (or other RNG)
13+
14+
**Quick solution**: `cargo update`
15+
16+
**Details**: This happens when multiple versions of the `rand_core` crate are in use. Check your `Cargo.lock` file for all versions of `rand_core`. Note that some versions (0.2.2 and 0.3.1) are compatibility shims and are not a problem by themselves.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## Background
11+
12+
**What is your motivation?**
13+
14+
**What type of application is this?** (E.g. cryptography, game, numerical simulation)
15+
16+
## Feature request
17+
18+
<details here>

.github/ISSUE_TEMPLATE/other.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Other
3+
about: empty template
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Suggest a change
3+
about: Describe this issue template's purpose here.
4+
title: 'CHANGE: <summary>'
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
A change request is considered a (small) Request-For-Comment, and requires a concrete proposal and motivation.
11+
12+
## Summary
13+
14+
How does this affect the API / end-user? (Include API-breaking changes, value-breaking changes and API additions.)
15+
16+
## Details
17+
18+
What changes does this require internally?
19+
20+
## Motivation
21+
22+
What is the motivation for this change?
23+
24+
Since every change has a cost (even if just API churn or extra code size), every change must have sufficient motivation. This is arguably the most important part of the RFC.
25+
26+
## Alternatives
27+
28+
Which alternatives might be considered, and why or why not?

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- [ ] Added a `CHANGELOG.md` entry
2+
3+
# Summary
4+
5+
# Motivation
6+
7+
# Details

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "monthly"

.github/workflows/test.yml

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
name: Main tests
2+
3+
on:
4+
push:
5+
branches: [ master, '0.[0-9]+' ]
6+
paths-ignore:
7+
- "**.md"
8+
- "benches/**"
9+
pull_request:
10+
branches: [ master, '0.[0-9]+' ]
11+
paths-ignore:
12+
- "**.md"
13+
- "benches/**"
14+
schedule:
15+
- cron: '0 0 * * SUN'
16+
17+
permissions:
18+
contents: read # to fetch code (actions/checkout)
19+
20+
jobs:
21+
clippy-fmt:
22+
name: Check Clippy and rustfmt
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: dtolnay/rust-toolchain@master
27+
with:
28+
toolchain: stable
29+
components: clippy, rustfmt
30+
- name: Check Clippy
31+
run: cargo clippy --workspace -- -D warnings
32+
- name: Check rustfmt
33+
run: cargo fmt --all -- --check
34+
35+
check-doc:
36+
name: Check doc
37+
runs-on: ubuntu-latest
38+
env:
39+
RUSTDOCFLAGS: "-Dwarnings --cfg docsrs -Zunstable-options --generate-link-to-definition"
40+
steps:
41+
- uses: actions/checkout@v4
42+
- name: Install toolchain
43+
uses: dtolnay/rust-toolchain@master
44+
with:
45+
toolchain: nightly
46+
- name: rand_core
47+
run: cargo doc --all-features --no-deps
48+
49+
test:
50+
runs-on: ${{ matrix.os }}
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
include:
55+
- os: ubuntu-latest
56+
target: x86_64-unknown-linux-gnu
57+
toolchain: stable
58+
- os: macos-latest
59+
target: x86_64-apple-darwin
60+
toolchain: stable
61+
# TODO: also aarch64 / M1
62+
- os: windows-latest
63+
target: x86_64-pc-windows-gnu
64+
toolchain: stable
65+
- os: windows-latest
66+
target: x86_64-pc-windows-msvc
67+
toolchain: beta
68+
# Test both windows-gnu and windows-msvc; use beta rust on one
69+
- os: ubuntu-latest
70+
target: x86_64-unknown-linux-gnu
71+
variant: MSRV
72+
toolchain: 1.85.0
73+
- os: ubuntu-latest
74+
deps: sudo apt-get update ; sudo apt install gcc-multilib
75+
target: i686-unknown-linux-gnu
76+
toolchain: nightly
77+
- os: ubuntu-latest
78+
target: x86_64-unknown-linux-gnu
79+
toolchain: nightly
80+
variant: minimal_versions
81+
82+
steps:
83+
- uses: actions/checkout@v4
84+
- name: Not MSRV
85+
if: ${{ matrix.variant != 'MSRV' }}
86+
run: cargo generate-lockfile --ignore-rust-version
87+
- name: Install toolchain
88+
uses: dtolnay/rust-toolchain@master
89+
with:
90+
target: ${{ matrix.target }}
91+
toolchain: ${{ matrix.toolchain }}
92+
- run: ${{ matrix.deps }}
93+
- name: Maybe minimal versions
94+
if: ${{ matrix.variant == 'minimal_versions' }}
95+
run: |
96+
cargo generate-lockfile -Z minimal-versions
97+
- name: Test rand_core
98+
run: |
99+
cargo test --target ${{ matrix.target }} --no-default-features
100+
cargo test --target ${{ matrix.target }} --features serde
101+
102+
test-cross:
103+
runs-on: ${{ matrix.os }}
104+
strategy:
105+
fail-fast: false
106+
matrix:
107+
include:
108+
- os: ubuntu-latest
109+
target: powerpc-unknown-linux-gnu
110+
toolchain: stable
111+
112+
steps:
113+
- uses: actions/checkout@v4
114+
- name: Install toolchain
115+
uses: dtolnay/rust-toolchain@master
116+
with:
117+
target: ${{ matrix.target }}
118+
toolchain: ${{ matrix.toolchain }}
119+
- name: Cache cargo plugins
120+
uses: actions/cache@v4
121+
with:
122+
path: ~/.cargo/bin/
123+
key: ${{ runner.os }}-cargo-plugins
124+
- name: Install cross
125+
run: cargo install cross || true
126+
- name: Test
127+
run: |
128+
# all stable features:
129+
cross test --no-fail-fast --target ${{ matrix.target }}
130+
131+
test-miri:
132+
runs-on: ubuntu-latest
133+
steps:
134+
- uses: actions/checkout@v4
135+
- name: Install toolchain
136+
run: |
137+
rustup toolchain install nightly --component miri
138+
rustup override set nightly
139+
cargo miri setup
140+
- name: Test rand
141+
run: |
142+
cargo miri test
143+
cargo miri test --features=serde
144+
cargo miri test --no-default-features
145+
146+
test-no-std:
147+
runs-on: ubuntu-latest
148+
steps:
149+
- uses: actions/checkout@v4
150+
- name: Install toolchain
151+
uses: dtolnay/rust-toolchain@nightly
152+
with:
153+
target: thumbv6m-none-eabi
154+
- name: Build top-level only
155+
run: cargo build --target=thumbv6m-none-eabi --no-default-features
156+
157+
test-ios:
158+
runs-on: macos-latest
159+
steps:
160+
- uses: actions/checkout@v4
161+
- name: Install toolchain
162+
uses: dtolnay/rust-toolchain@nightly
163+
with:
164+
target: aarch64-apple-ios
165+
- name: Build top-level only
166+
run: cargo build --target=aarch64-apple-ios

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target
2+
Cargo.lock

0 commit comments

Comments
 (0)