1
0
mirror of https://github.com/bspeice/qadapt synced 2024-11-21 05:18:09 -05:00

Use new CI template

This commit is contained in:
Bradlee Speice 2018-12-02 22:42:29 -05:00
parent 095fd797c4
commit 3e0770400d
10 changed files with 205 additions and 11 deletions

2
.gitignore vendored
View File

@ -1,5 +1,3 @@
/target /target
**/*.rs.bk **/*.rs.bk
Cargo.lock Cargo.lock
*.swp
.idea/

75
.travis.yml Normal file
View File

@ -0,0 +1,75 @@
# Created by the Rust CI generator: https://github.com/bspeice/rust-ci
dist: trusty
language: rust
# Used during coverage to build kcov
addons.apt.packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- binutils-dev
matrix:
include:
# Uniquely identifies the build that uploads to codecov.io
- env: CODECOV=TRUE
rust: nightly
# Uniquely identifies the build that uploads to crates.io
- env: CRATESIO=TRUE
rust: nightly
- rust: nightly
# To build against specific Rust versions, include an item like the following:
# - rust: 1.30.0
- rust: nightly
os: osx
before_install:
- set -e
- rustup self update
install:
- source ~/.cargo/env || true
script:
- rustup component add rustfmt-preview
- cargo fmt --all -- --check
- |
if [ -z "$TRAVIS_TAG" ]; then
cargo test
cargo test --release
fi
after_script: set +e
after_success: |
# Build test coverage statistics
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && \
tar xzf master.tar.gz && \
cd kcov-master && \
mkdir build && \
cd build && \
cmake .. && \
make && \
make install DESTDIR=../../kcov-build && \
rm -rf kcov-master && \
for file in target/debug/*-*[^\.d]; do \
mkdir -p "target/cov/$(basename $file)"; \
./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; \
done && \
bash <(curl -s https://codecov.io/bash) && \
echo "Uploaded code coverage"
branches:
only:
# Release tags - vX.Y.Z
- /^v\d+\.\d+\.\d+.*$/
- master
deploy:
- provider: cargo
on:
condition: "$CRATESIO = TRUE"
tags: true
skip_cleanup: true
token: "0I4H/gLnBP0G26lTWKAWTVzgBNulh1Ih4XIYtAtOSf5TTAH4J7h634qPCVU/D73RhyYQKIUT9FxtY107tPNDKqFDY0QK6WgJJIsHJw4LuS2A2XdPp7i5lU8LMc58o0Qq2wGV+1Fy5QLfMt0OfKJcu0QdZiOYffOL5Vquj6srlq0xhslD3Xit87P4H5tqQYHoKXNwkWFZhRPOMep14oU1F7gUrAFMFIxnHxpii06v3TYz1pmQ4xxfO8ElM8br6uhahgngAnJSmN57kPWpU43g2zltJEH6Hi0HDu0mzKTbkqFv/JXSuVd43vC6p8NGURdojTII3zsZ5Cg4R6Xnd/z++2QH71S9eD3FtyVp0pwprJxjLc2BLx/b53bD6i8YR2wLpuPk+d2Ghr04zJRPNNm2DK4Hpq2pk3pt06l3YnkJU3hb7Fbt8dacXag/3y6lf70Mj58bVcNuItVWF1u7+DTaVM5XdsD7ZerYRm0E4r5IbukEwz4Cjk4UCbFZgFk46jsG+AQ3ngIw1wjwAx16tpCmRKUNwR1h31TlKFm9ihE/kDiabia56jYJyzWhSu5GHppSEWmHBLajEse7SowpDTIAyJLKD3QG6/YT+ukulkb1lweS6AvlYaKiJo0H2h7ndUhXDMn9SnJUTQmFcnQ3N125l+NC6BY+Z1P/Sk7fKXmy55k="

31
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,31 @@
# Contributing
If you're interested in assisting with development, here are the best ways to help:
## Bug Reports
While this repository has automated testing in place, testing is no replacement for
real-world usage. If you have questions about what behavior should be, please open
an issue [on Github](https://github.com/bspeice/qadapt/issues).
## Feature Requests
The work of coding is never finished. If you have ideas on how to make this code
better for the future, please open an issue [on Github](https://github.com/bspeice/qadapt/issues).
Writing code to implement the feature isn't mandatory (though is appreciated),
and there are no bad suggestions.
## Documentation/Examples
To make this project easy to use, additional documentation and usage examples
are greatly appreciated. Please also feel free to report typos and other
documentation clarity errors.
## Pull Requests
Thanks for your contribution! To assist expediently merging your code,
please ensure the following have been run:
- [] `cargo fmt`
- [] `make doc`

2
CONTRIBUTORS.md Normal file
View File

@ -0,0 +1,2 @@
`qadapt` is developed by:
Bradlee Speice <bradlee@speice.io>

View File

@ -1,10 +1,11 @@
Copyright 2018 Bradlee Speice Copyright 2018 Bradlee Speice
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,

19
Makefile Normal file
View File

@ -0,0 +1,19 @@
.PHONY: all
all:
@echo 'Please use `cargo` commands to manage building/testing qadapt'
.PHONY: contributors
contributors:
@echo '`qadapt` is developed by:' > CONTRIBUTORS.md
@echo ' Bradlee Speice <bradlee@speice.io>' >> CONTRIBUTORS.md
@git log --format=' %aN <%aE>' | grep -v "Bradlee Speice <bradlee@speice.io>" | sort -u >> CONTRIBUTORS.md
.PHONY: readme README.md
readme: README.md
README.md: src/lib.rs
@sed -i '/---/q' README.md
@cat src/lib.rs | grep '//!' | sed 's/^\/\/\! *//g' >> README.md
.PHONY: doc
doc: readme contributors

View File

@ -1,17 +1,25 @@
The Quick And Dirty Allocation Profiling Tool # qadapt
=============================================
[![crates.io](https://img.shields.io/crates/v/qadapt.svg)](https://crates.io/crates/qadapt) [![crates.io](https://img.shields.io/crates/v/qadapt.svg)](https://crates.io/crates/qadapt)
[![docs.rs](https://docs.rs/qadapt/badge.svg)](https://docs.rs/qadapt/) [![docs.rs](https://docs.rs/qadapt/badge.svg)](https://docs.rs/qadapt/)
[![travisci](https://travis-ci.org/bspeice/qadapt.svg?branch=master)](https://travis-ci.org/bspeice/qadapt)
<!--
AppVeyor badges use a unique ID that we're not able to compute ahead of time.
Please see https://ci.appveyor.com/project/bspeice/qadapt/settings/badges
to set up the badge
-->
[![codecov](https://codecov.io/gh/bspeice/qadapt/branch/master/graph/badge.svg)](https://codecov.io/gh/bspeice/qadapt)
---
# The Quick And Dirty Allocation Profiling Tool
This allocator is a helper for writing high-performance code that is allocation/drop free; This allocator is a helper for writing high-performance code that is allocation/drop free;
for functions annotated with `#[allocate_panic]`, QADAPT will detect when allocations/drops for functions annotated with `#[allocate_panic]`, QADAPT will detect when allocations/drops
happen during their execution (and execution of any functions they call) and throw a happen during their execution (and execution of any functions they call) and throw a
thread panic if this occurs. thread panic if this occurs. QADAPT-related code is *stripped out during release builds*,
so no worries about random allocations crashing in production.
Because QADAPT panics on allocation and is rather slow (for an allocator) it is **strongly** Currently this crate is Nightly-only, but will work once `const fn` is in Stable.
recommended that QADAPT (the allocator) be used only in code tests. Functions annotated with
`#[allocate_panic]` will have no side effects if the QADAPT allocator is not being used,
so the attribute is safe to leave everywhere.
Currently this crate is Nightly-only, but will work once `const fn` is in Stable. Please also take a look at [qadapt-macro](https://github.com/bspeice/qadapt/tree/master/qadapt-macro)
for some helper macros to make working with QADAPT a bit easier.

59
appveyor.yml Normal file
View File

@ -0,0 +1,59 @@
environment:
matrix:
# MinGW
- TARGET: i686-pc-windows-gnu
RUST_VERSION: stable
- TARGET: x86_64-pc-windows-gnu
RUST_VERSION: stable
# MSVC
- TARGET: i686-pc-windows-msvc
RUST_VERSION: stable
- TARGET: x86_64-pc-windows-msvc
RUST_VERSION: stable
# Testing other channels
- TARGET: x86_64-pc-windows-gnu
RUST_VERSION: 1.30.1
- TARGET: x86_64-pc-windows-gnu
RUST_VERSION: nightly
- TARGET: x86_64-pc-windows-msvc
RUST_VERSION: nightly
install:
- ps: >-
If ($Env:TARGET -eq 'x86_64-pc-windows-gnu') {
$Env:PATH += ';C:\msys64\mingw64\bin'
} ElseIf ($Env:TARGET -eq 'i686-pc-windows-gnu') {
$Env:PATH += ';C:\msys64\mingw32\bin'
}
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
- rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION%
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
- rustc -Vv
- cargo -V
test_script:
# If you need to run additional steps during testing, they should be placed
# inside this block
- if [%APPVEYOR_REPO_TAG%]==[false] (
cargo test --target %TARGET% &&
cargo test --target %TARGET% --release
)
cache:
- C:\Users\appveyor\.cargo\registry
- target
branches:
only:
# release tag format is "vX.Y.Z"
- /^v\d+\.\d+\.\d+.*$/
- master
notifications:
- provider: Email
on_build_success: false
# Building is done in the test phase, so we disable Appveyor's build phase.
build: false

1
rustfmt.toml Normal file
View File

@ -0,0 +1 @@
# Empty file uses default settings