Skip to content

Commit

Permalink
Switch to GitHub actions
Browse files Browse the repository at this point in the history
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
  • Loading branch information
saschagrunert committed Apr 30, 2021
1 parent 80cd5a1 commit cabefa4
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 137 deletions.
130 changes: 0 additions & 130 deletions .circleci/config.yml

This file was deleted.

151 changes: 151 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: test
on:
push:
tags:
- v*
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: cargo generate-lockfile
- uses: actions/cache@v2
with:
path: |
target
~/.cargo/registry
key: rust-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: rust-build-
- run: make

rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt
- run: cargo generate-lockfile
- uses: actions/cache@v2
with:
path: |
target
~/.cargo/registry
key: rust-lint-rustfmt-${{ hashFiles('**/Cargo.lock') }}
restore-keys: rust-lint-rustfmt-
- run: make lint-rustfmt

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy
- run: cargo generate-lockfile
- uses: actions/cache@v2
with:
path: |
target
~/.cargo/registry
key: rust-lint-clippy-${{ hashFiles('**/Cargo.lock') }}
restore-keys: rust-lint-clippy-
- run: make lint-clippy

unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: cargo generate-lockfile
- uses: actions/cache@v2
with:
path: |
target
~/.cargo/registry
key: rust-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: rust-test-
- run: make test

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
version: '0.15.0'
args: '-- --test-threads 1'
- name: Upload to codecov.io
uses: codecov/codecov-action@v1.4.1
- name: Archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: cobertura.xml

doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: cargo generate-lockfile
- uses: actions/cache@v2
with:
path: |
target
~/.cargo/registry
key: rust-doc-${{ hashFiles('**/Cargo.lock') }}
restore-keys: rust-doc-
- run: make build-doc
- uses: actions/upload-artifact@v2
with:
name: docs
path: target/doc

doc-publish:
if: github.ref == 'refs/heads/master'
needs: doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- uses: actions/download-artifact@v2
with:
name: docs
path: target/doc
- name: Update gh-pages branch
run: |
git config --global user.email mail@saschagrunert.de
git config --global user.name "CircleCI"
git fetch origin gh-pages
git checkout -f gh-pages
rm -rf doc
mv target/doc .
git add .
git diff-index --quiet HEAD || git commit -m 'Update documentation'
git push -f origin gh-pages
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ GENERAL_ARGS = --release
.PHONY: \
build \
build-doc \
coverage \
lint-rustfmt \
lint-clippy
lint-clippy \
test

ifndef VERBOSE
.SILENT:
Expand All @@ -21,12 +21,12 @@ build:
build-doc:
cargo doc --all --no-deps

coverage:
cargo kcov --features="par_iter"

lint-clippy:
cargo clippy -- -D warnings

lint-rustfmt:
cargo fmt
git diff --exit-code

test:
cargo test --features="par_iter"
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# indextree

[![Build status](https://circleci.com/gh/saschagrunert/indextree.svg?style=shield)](https://circleci.com/gh/saschagrunert/indextree)
[![Build Status](https://travis-ci.org/saschagrunert/indextree.svg)](https://travis-ci.org/saschagrunert/indextree)
[![Build status](https://ci.appveyor.com/api/projects/status/byraapuh9py02us0?svg=true)](https://ci.appveyor.com/project/saschagrunert/indextree)
[![Coverage](https://codecov.io/gh/saschagrunert/indextree/branch/master/graph/badge.svg)](https://codecov.io/gh/saschagrunert/indextree)
[![Dependency Status](https://deps.rs/repo/github/saschagrunert/indextree/status.svg)](https://deps.rs/repo/github/saschagrunert/indextree)
Expand Down
2 changes: 2 additions & 0 deletions src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ impl fmt::Display for NodeId {
}
}

#[allow(clippy::from_over_into)]
impl Into<NonZeroUsize> for NodeId {
fn into(self) -> NonZeroUsize {
self.index1
}
}

#[allow(clippy::from_over_into)]
impl Into<usize> for NodeId {
fn into(self) -> usize {
self.index1.get()
Expand Down

0 comments on commit cabefa4

Please sign in to comment.