Browse Source

Use new CI template

Bradlee Speice 5 months ago
parent
commit
3e0770400d
10 changed files with 205 additions and 11 deletions
  1. 0
    2
      .gitignore
  2. 75
    0
      .travis.yml
  3. 0
    0
      CHANGELOG.md
  4. 31
    0
      CONTRIBUTING.md
  5. 2
    0
      CONTRIBUTORS.md
  6. 2
    1
      LICENSE
  7. 19
    0
      Makefile
  8. 16
    8
      README.md
  9. 59
    0
      appveyor.yml
  10. 1
    0
      rustfmt.toml

+ 0
- 2
.gitignore View File

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

+ 75
- 0
.travis.yml View File

@@ -0,0 +1,75 @@
1
+# Created by the Rust CI generator: https://github.com/bspeice/rust-ci
2
+dist: trusty
3
+language: rust
4
+# Used during coverage to build kcov
5
+addons.apt.packages:
6
+  - libcurl4-openssl-dev
7
+  - libelf-dev
8
+  - libdw-dev
9
+  - binutils-dev
10
+
11
+matrix:
12
+  include:
13
+    # Uniquely identifies the build that uploads to codecov.io
14
+    - env: CODECOV=TRUE
15
+      rust: nightly
16
+    # Uniquely identifies the build that uploads to crates.io
17
+    - env: CRATESIO=TRUE
18
+      rust: nightly
19
+    - rust: nightly
20
+    # To build against specific Rust versions, include an item like the following:
21
+    # - rust: 1.30.0
22
+    - rust: nightly
23
+      os: osx
24
+
25
+before_install:
26
+  - set -e
27
+  - rustup self update
28
+
29
+install:
30
+  - source ~/.cargo/env || true
31
+
32
+script:
33
+  - rustup component add rustfmt-preview
34
+  - cargo fmt --all -- --check
35
+  - |
36
+    if [ -z "$TRAVIS_TAG" ]; then
37
+      cargo test
38
+      cargo test --release
39
+    fi
40
+
41
+after_script: set +e
42
+after_success: |
43
+    # Build test coverage statistics
44
+    wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && \
45
+    tar xzf master.tar.gz && \
46
+    cd kcov-master && \
47
+		mkdir build && \
48
+		cd build && \
49
+		cmake .. && \
50
+		make && \
51
+		make install DESTDIR=../../kcov-build && \
52
+    rm -rf kcov-master && \
53
+    for file in target/debug/*-*[^\.d]; do \
54
+      mkdir -p "target/cov/$(basename $file)"; \
55
+      ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; \
56
+    done && \
57
+    bash <(curl -s https://codecov.io/bash) && \
58
+    echo "Uploaded code coverage"
59
+
60
+branches:
61
+  only:
62
+    # Release tags - vX.Y.Z
63
+    - /^v\d+\.\d+\.\d+.*$/
64
+    - master
65
+
66
+
67
+deploy:
68
+  - provider: cargo
69
+    on:
70
+      condition: "$CRATESIO = TRUE"
71
+      tags: true
72
+    skip_cleanup: true
73
+    token: "0I4H/gLnBP0G26lTWKAWTVzgBNulh1Ih4XIYtAtOSf5TTAH4J7h634qPCVU/D73RhyYQKIUT9FxtY107tPNDKqFDY0QK6WgJJIsHJw4LuS2A2XdPp7i5lU8LMc58o0Qq2wGV+1Fy5QLfMt0OfKJcu0QdZiOYffOL5Vquj6srlq0xhslD3Xit87P4H5tqQYHoKXNwkWFZhRPOMep14oU1F7gUrAFMFIxnHxpii06v3TYz1pmQ4xxfO8ElM8br6uhahgngAnJSmN57kPWpU43g2zltJEH6Hi0HDu0mzKTbkqFv/JXSuVd43vC6p8NGURdojTII3zsZ5Cg4R6Xnd/z++2QH71S9eD3FtyVp0pwprJxjLc2BLx/b53bD6i8YR2wLpuPk+d2Ghr04zJRPNNm2DK4Hpq2pk3pt06l3YnkJU3hb7Fbt8dacXag/3y6lf70Mj58bVcNuItVWF1u7+DTaVM5XdsD7ZerYRm0E4r5IbukEwz4Cjk4UCbFZgFk46jsG+AQ3ngIw1wjwAx16tpCmRKUNwR1h31TlKFm9ihE/kDiabia56jYJyzWhSu5GHppSEWmHBLajEse7SowpDTIAyJLKD3QG6/YT+ukulkb1lweS6AvlYaKiJo0H2h7ndUhXDMn9SnJUTQmFcnQ3N125l+NC6BY+Z1P/Sk7fKXmy55k="
74
+
75
+     

CHANGELOG → CHANGELOG.md View File


+ 31
- 0
CONTRIBUTING.md View File

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

+ 2
- 0
CONTRIBUTORS.md View File

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

+ 2
- 1
LICENSE View File

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

+ 19
- 0
Makefile View File

@@ -0,0 +1,19 @@
1
+.PHONY: all
2
+all:
3
+	@echo 'Please use `cargo` commands to manage building/testing qadapt'
4
+
5
+.PHONY: contributors
6
+contributors:
7
+	@echo '`qadapt` is developed by:' > CONTRIBUTORS.md
8
+	@echo '  Bradlee Speice <bradlee@speice.io>' >> CONTRIBUTORS.md
9
+	@git log --format='  %aN <%aE>' | grep -v "Bradlee Speice <bradlee@speice.io>" | sort -u >> CONTRIBUTORS.md
10
+
11
+.PHONY: readme README.md
12
+readme: README.md
13
+
14
+README.md: src/lib.rs
15
+	@sed -i '/---/q' README.md
16
+	@cat src/lib.rs | grep '//!' | sed 's/^\/\/\! *//g' >> README.md
17
+
18
+.PHONY: doc
19
+doc: readme contributors

+ 16
- 8
README.md View File

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

+ 59
- 0
appveyor.yml View File

@@ -0,0 +1,59 @@
1
+environment:
2
+  matrix:
3
+    # MinGW
4
+    - TARGET: i686-pc-windows-gnu
5
+      RUST_VERSION: stable
6
+    - TARGET: x86_64-pc-windows-gnu
7
+      RUST_VERSION: stable
8
+
9
+    # MSVC
10
+    - TARGET: i686-pc-windows-msvc
11
+      RUST_VERSION: stable
12
+    - TARGET: x86_64-pc-windows-msvc
13
+      RUST_VERSION: stable
14
+
15
+    # Testing other channels
16
+    - TARGET: x86_64-pc-windows-gnu
17
+      RUST_VERSION: 1.30.1
18
+    - TARGET: x86_64-pc-windows-gnu
19
+      RUST_VERSION: nightly
20
+    - TARGET: x86_64-pc-windows-msvc
21
+      RUST_VERSION: nightly
22
+
23
+install:
24
+  - ps: >-
25
+      If ($Env:TARGET -eq 'x86_64-pc-windows-gnu') {
26
+        $Env:PATH += ';C:\msys64\mingw64\bin'
27
+      } ElseIf ($Env:TARGET -eq 'i686-pc-windows-gnu') {
28
+        $Env:PATH += ';C:\msys64\mingw32\bin'
29
+      }
30
+  - curl -sSf -o rustup-init.exe https://win.rustup.rs/
31
+  - rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION%
32
+  - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
33
+  - rustc -Vv
34
+  - cargo -V
35
+
36
+test_script:
37
+  # If you need to run additional steps during testing, they should be placed
38
+  # inside this block
39
+  - if [%APPVEYOR_REPO_TAG%]==[false] (
40
+      cargo test --target %TARGET% &&
41
+      cargo test --target %TARGET% --release
42
+    )
43
+
44
+cache:
45
+  - C:\Users\appveyor\.cargo\registry
46
+  - target
47
+
48
+branches:
49
+  only:
50
+    # release tag format is "vX.Y.Z"
51
+    - /^v\d+\.\d+\.\d+.*$/
52
+    - master
53
+
54
+notifications:
55
+  - provider: Email
56
+    on_build_success: false
57
+
58
+# Building is done in the test phase, so we disable Appveyor's build phase.
59
+build: false

+ 1
- 0
rustfmt.toml View File

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

Loading…
Cancel
Save