Skip to content

Commit

Permalink
cleanup pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
nbari committed Feb 1, 2024
1 parent f32e4ba commit f09cd9c
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 74 deletions.
3 changes: 3 additions & 0 deletions .github/actions-rs/grcov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
output-type: lcov
output-file: ./lcov.info
2 changes: 2 additions & 0 deletions .github/workflows/.codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[codespell]
ignore-words-list = crate
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: Build

on:
push:
tags:
- '*'
workflow_dispatch:

permissions:
contents: write

jobs:
test:
uses: ./.github/workflows/test.yml

build:
name: Test build
runs-on: ${{ matrix.os }}
needs: test

strategy:
matrix:
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-musl

- build: macos
os: macos-latest
target: x86_64-apple-darwin

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get the release version from the tag
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Build
run: |
cargo build --release --target ${{ matrix.target }}
publish:
name: Publish
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
67 changes: 0 additions & 67 deletions .github/workflows/ci.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
name: Test

on:
workflow_call:
pull_request:
branches:
- '*'

jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- name: Format
run: cargo fmt --all -- --check

lint:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- name: Clippy
run: cargo clippy -- -D clippy::all -D clippy::nursery -D warnings

check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- name: Check
run: cargo check

test:
name: Test
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
rust:
- stable
runs-on: ${{ matrix.os }}
needs:
- format
- lint
- check
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- name: test
run: cargo test

coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly

- name: Run tests
run: cargo test --verbose
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code
-Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests
RUSTDOCFLAGS: -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code
-Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests

- name: rust-grcov
uses: actions-rs/grcov@v0.1

- name: Upload to codecov.io
uses: codecov/codecov-action@v3

- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2
9 changes: 3 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fork"
version = "0.1.22"
version = "0.1.23"
authors = ["Nicolas Embriz <nbari@tequila.io>"]
description = "Library for creating a new process detached from the controlling terminal (daemon)"
documentation = "https://docs.rs/fork/latest/fork/"
Expand All @@ -9,11 +9,8 @@ repository = "https://github.com/immortal/fork"
readme = "README.md"
keywords = ["fork", "setsid", "daemon", "process", "daemonize"]
categories = ["command-line-utilities", "os"]
license = "BSD-3-Clause"
edition = "2018"

[badges]
travis-ci = { repository = "immortal/fork", branch = "master" }
license-file = "BSD-3-Clause"
edition = "2021"

[dependencies]
libc = "0.2"
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# fork

[![crates.io](https://img.shields.io/crates/v/fork.svg)](https://crates.io/crates/fork)
[![Build Status](https://travis-ci.org/immortal/fork.svg?branch=master)](https://travis-ci.org/immortal/fork)
[![Build](https://github.com/immortal/fork/actions/workflows/build.yml/badge.svg)](https://github.com/immortal/fork/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/immortal/fork/graph/badge.svg?token=LHZW56OC10)](https://codecov.io/gh/immortal/fork)
[![docs](https://docs.rs/fork/badge.svg)](https://docs.rs/fork)

Library for creating a new process detached from the controlling terminal (daemon).
Expand Down

0 comments on commit f09cd9c

Please sign in to comment.