Skip to content

Commit

Permalink
Update develop from main
Browse files Browse the repository at this point in the history
Add workflows
  • Loading branch information
Sellig6792 authored Dec 29, 2022
2 parents cdedb08 + b478187 commit a5b13b2
Show file tree
Hide file tree
Showing 5 changed files with 217 additions and 6 deletions.
Empty file added .cargo/config.toml
Empty file.
76 changes: 76 additions & 0 deletions .github/workflows/feature_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Feature PR

on:
pull_request:
branches: [ "develop" ]

env:
CARGO_TERM_COLOR: always

jobs:
style:
name: Check Style
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
profile: minimal
override: true

- name: cargo fmt -- --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check


test:
name: Test
needs: [style]
runs-on: ubuntu-latest

strategy:
matrix:
build: [stable, beta, nightly]
include:
- build: beta
rust: beta
- build: nightly
rust: nightly
benches: true

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

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust || 'stable' }}
profile: minimal
override: true

- name: Build debug
uses: actions-rs/cargo@v1
with:
command: build
args: ${{ matrix.features }}

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.features }}

- name: Test all benches
if: matrix.benches
uses: actions-rs/cargo@v1
with:
command: test
args: --benches ${{ matrix.features }}
135 changes: 135 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: Release

on:
push:
tags:
- "v*.*.*"
- "!v*.*.*-{alpha,beta,rc}*"

env:
CARGO_TERM_COLOR: always

jobs:
# style:
# name: Check Style
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v1
#
# - name: Install rust
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# components: rustfmt
# profile: minimal
# override: true
#
# - name: cargo fmt -- --check
# uses: actions-rs/cargo@v1
# with:
# command: fmt
# args: --all -- --check


test:
name: Test
# needs: [style]
runs-on: ubuntu-latest

strategy:
matrix:
build: [ stable, beta, nightly ]
include:
- build: beta
rust: beta
- build: nightly
rust: nightly
benches: true

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

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust || 'stable' }}
profile: minimal
override: true

- name: Build debug
uses: actions-rs/cargo@v1
with:
command: build
args: ${{ matrix.features }}

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.features }}

- name: Test all benches
if: matrix.benches
uses: actions-rs/cargo@v1
with:
command: test
args: --benches ${{ matrix.features }}
deploy:
name: Deploy
needs: [ test ]
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
target: [ aarch64-unknown-linux-gnu,
armv7-unknown-linux-gnueabihf,
i686-unknown-linux-gnu, i686-unknown-linux-musl,
mips-unknown-linux-gnu, mips64-unknown-linux-gnuabi64, mips64el-unknown-linux-gnuabi64, mipsel-unknown-linux-gnu,
powerpc-unknown-linux-gnu, powerpc64-unknown-linux-gnu, powerpc64le-unknown-linux-gnu,
arm-unknown-linux-gnueabi,
x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl, x86_64-pc-windows-gnu ]
os: [ ubuntu-latest ]

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



# Runs on latest ubuntu by default except for windows targets
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}

- name: Build release
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }}

- name: Rename binary (Linux & macOS)
if: matrix.target != 'x86_64-pc-windows-gnu'
run: mv target/${{ matrix.target }}/release/fbf target/${{ matrix.target }}/release/fbf-${{ matrix.target }}

- name: Rename binary (Windows)
if: matrix.target == 'x86_64-pc-windows-gnu'
run: mv target/${{ matrix.target }}/release/fbf.exe target/${{ matrix.target }}/release/fbf-${{ matrix.target }}.exe


- name: Upload release
uses: softprops/action-gh-release@v1
with:
files: target/${{ matrix.target }}/release/fbf-${{ matrix.target }}*
discussion_category_name: Q&A
token: ${{ secrets.PAT_GITHUB }}
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name = "fbf"
path = "src/main.rs"

[dependencies]
clap = { version = "4.0.30", features = ["derive"] }
anyhow = "1.0.51"
clap = { version = "4.0.32", features = ["derive"] }
anyhow = "1.0.68"
rand = "0.8.5"
num = "0.4.0"

0 comments on commit a5b13b2

Please sign in to comment.