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

synchronize CI functions with Amethyst #233

Merged
merged 18 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

custom: ['https://amethyst.rs/donate']
open_collective: amethyst
27 changes: 27 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--- Provide a general summary of your changes in the Title above -->
## Description
<!--- Describe your changes in detail -->
<!--- Separate Additions, Removals and Modifications -->



## 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. -->



## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme.
- [ ] My code follows the code style of this project.
- [ ] If my change required a change to the documentation I have updated the documentation accordingly.
- [ ] I have updated the content of the book if this PR would make the book outdated.
- [ ] I have added tests to cover my changes.
- [ ] My code is used in an example.
32 changes: 32 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
template: |
# What's Changed

$CHANGES
categories:
- title: '🚀 Features and Improvements'
labels:
- 'type: feature'
- 'type: improvement'
- title: '🐛 Bug Fixes'
labels:
- 'type: bug'
- title: '🧰 Maintenance'
labels:
- 'type: maintenance'

version-resolver:
minor:
labels:
- 'type: breaking'
patch:
labels:
- 'type: feature'
- 'type: improvement'
- 'type: bug'
- 'type: maintenance'
- 'team: documentation'

exclude-labels:
- 'skip-changelog'
130 changes: 49 additions & 81 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,99 +1,67 @@
name: CI

on:
on:
push:
branches:
- main
- master
# bors needs CI to trigger for pushes to its staging/trying branches
- staging
- trying
pull_request:

env:
RUSTFLAGS: -Cdebuginfo=0
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1

jobs:
check:
name: Compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- uses: actions/[email protected]
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-
- uses: actions-rs/cargo@v1
with:
command: test
args: --all

check-features:
name: Features
runs-on: ubuntu-latest
needs: [check]
tests:
name: Tests
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
strategy:
fail-fast: true
matrix:
features:
- --all-features --release
- --no-default-features --release
- --all-features
- --no-default-features
- --no-default-features --features parallel
- --no-default-features --features extended-tuple-impls
- --no-default-features --features serialize
os: [macos-latest, windows-latest, ubuntu-latest]
toolchain: [stable, beta, nightly]
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- uses: actions/[email protected]
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-
- uses: actions-rs/cargo@v1
with:
command: test
args: --all ${{ matrix.features }}
- uses: actions/checkout@v2

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
- name: install ${{ matrix.toolchain }} toolchain
id: install_toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: CFG_RELEASE_CHANNEL="nightly" CFG_RELEASE="nightly" cargo +nightly install --force rustfmt-nightly --git https://github.com/rust-lang/rustfmt --tag v1.4.35 --all-features
if: matrix.toolchain == 'nightly' && matrix.os == 'ubuntu-latest'

- run: cargo +nightly fmt --all -- --check
if: matrix.toolchain == 'nightly' && matrix.os == 'ubuntu-latest'

- run: rustup component add clippy
- uses: actions-rs/cargo@v1
if: matrix.toolchain == 'nightly'

- run: cargo +nightly clippy -Z unstable-options --workspace --all-targets --all-features
if: matrix.toolchain == 'nightly'

- run: cargo install cargo-hack
- run: cargo hack test --workspace --each-feature

- uses: peaceiris/actions-mdbook@v1
with:
command: clippy
args: --all -- -D warnings
mdbook-version: 'latest'
if: matrix.toolchain == 'stable' && matrix.os == 'ubuntu-latest'

- run: cargo install mdbook-linkcheck
if: matrix.toolchain == 'stable' && matrix.os == 'ubuntu-latest'

- run: mdbook build docs/book
if: matrix.toolchain == 'stable' && matrix.os == 'ubuntu-latest'

- run: mdbook test -L ./target/debug/deps docs/book
if: matrix.toolchain == 'stable' && matrix.os == 'ubuntu-latest'
24 changes: 24 additions & 0 deletions .github/workflows/deny.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: cargo-deny

on: [pull_request]

env:
CARGO_TERM_COLOR: always

jobs:
cargo-deny:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans licenses sources

# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'advisories' }}

steps:
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
14 changes: 14 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Release Drafter

on:
push:
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
target
**/*.rs.bk
Cargo.lock
docs/book/book
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"rust-analyzer.lens.enable": false,
"rust-analyzer.checkOnSave.overrideCommand": [
"cargo",
"+nightly",
"clippy",
"-Z",
"unstable-options",
"--message-format=json",
"--workspace",
"--no-default-features",
"--all-targets"
],
}
Comment on lines +1 to +14
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this committed to the repo? The CodeLens disable in particular seems suspect?

20 changes: 15 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ wasm-bindgen = ["uuid/wasm-bindgen"]
[dependencies]
legion_codegen = { path = "codegen", version = "0.3", optional = true }
smallvec = "1.4"
itertools = "0.9"
itertools = "0.10"
downcast-rs = "1.2"
derivative = "2.1"
paste = "1.0.0"
parking_lot = "0.11"
bit-set = "0.5"
#tracing = "0.1"
thiserror = "1.0"
uuid = { version = "0.8", features = ["v4"] }
rayon = { version = "1.4", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
erased-serde = { version = "0.3", optional = true }
crossbeam-channel = {version ="0.4", optional = true}
crossbeam-channel = { version = "0.5", optional = true }
atomic_refcell = "0.1.6"

[dev-dependencies]
serde_json = "1.0"
bincode = "1.3"
criterion = "0.3"
cgmath = "0.17"
cgmath = "0.18"
trybuild = "1.0"

[[bench]]
Expand All @@ -51,11 +51,21 @@ harness = false
[[bench]]
name = "parallel_query"
harness = false
required-features = ["parallel"]

[[bench]]
name = "transform"
harness = false
required-features = ["parallel"]

[[bench]]
name = "insertion"
harness = false
harness = false

[[test]]
name = "codegen"
required-features = ["codegen"]

[[test]]
name = "systems_par_for_each"
required-features = ["parallel"]
1 change: 0 additions & 1 deletion benches/benchmarks.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use criterion::*;
use itertools::*;

use legion::*;

#[derive(Copy, Clone, Debug, PartialEq)]
Expand Down
7 changes: 3 additions & 4 deletions benches/insertion.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use criterion::*;

use legion::*;

fn bench_insert_zero_baseline(c: &mut Criterion) {
c.bench_function("insert_zero_baseline", |b| {
b.iter(|| {
//let universe = Universe::new();
//let mut world = universe.create_world();
let components: Vec<isize> = (0..10000).map(|i| i).collect();
let components: Vec<isize> = (0..10000).collect();
criterion::black_box(components);
});
});
Expand All @@ -17,7 +16,7 @@ fn bench_insert_one_baseline(c: &mut Criterion) {
c.bench_function("insert_one_baseline", |b| {
b.iter(|| {
let mut world = World::default();
let components: Vec<isize> = (0..10000).map(|i| i).collect();
let components: Vec<isize> = (0..10000).collect();
criterion::black_box(components);

world.extend(vec![(1usize,)]);
Expand All @@ -29,7 +28,7 @@ fn bench_insert_unbatched(c: &mut Criterion) {
c.bench_function("insert_unbatched", |b| {
b.iter(|| {
let mut world = World::default();
let components: Vec<isize> = (0..10000).map(|i| i).collect();
let components: Vec<isize> = (0..10000).collect();

for component in components {
world.extend(vec![(component,)]);
Expand Down
Loading