-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub actions, remove Travis (#20)
- Loading branch information
Jason Mobarak
authored
Feb 11, 2021
1 parent
caa3b8b
commit 7c1dcea
Showing
8 changed files
with
188 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
pull_request: | ||
jobs: | ||
lint: | ||
name: Format and lint | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
name: Install Rust | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
components: rustfmt, clippy | ||
- uses: actions-rs/cargo@v1 | ||
name: Format Check | ||
with: | ||
command: fmt | ||
args: -- --check | ||
- uses: actions-rs/cargo@v1 | ||
name: Lint | ||
with: | ||
command: clippy | ||
args: --all-features --all-targets -- -D warnings | ||
test: | ||
name: Tests | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
name: Install Rust | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
name: Run tests | ||
with: | ||
command: test | ||
args: --all-features --all-targets | ||
build: | ||
name: Build binaries | ||
needs: | ||
- lint | ||
- test | ||
strategy: | ||
matrix: | ||
os: [windows-2019, macos-10.15, ubuntu-18.04] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
name: Install Rust | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: davidB/rust-cargo-make@v1 | ||
- name: Run CI | ||
run: cargo make ci-flow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Publish | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
build: | ||
name: Publish for ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-18.04 | ||
binary_target: x86_64-unknown-linux-musl | ||
- os: windows-2019 | ||
binary_target: x86_64-pc-windows-msvc | ||
- os: macos-10.15 | ||
binary_target: x86_64-apple-darwin | ||
steps: | ||
- name: Install musl tools | ||
if: matrix.os == 'ubuntu-18.04' | ||
run: sudo apt-get install musl-tools | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install rust for target ${{ matrix.binary_target }} | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable-${{ matrix.binary_target }} | ||
profile: minimal | ||
- uses: davidB/rust-cargo-make@v1 | ||
- name: Pull tags | ||
run: git fetch --tags --prune --unshallow | ||
- name: Fetch `git describe --tags` | ||
id: git_describe | ||
run: | | ||
echo "::set-output name=result::$(git describe --tags)" | ||
- name: Build Binary | ||
run: " | ||
cargo make zip-release-ci-flow | ||
--env CARGO_MAKE_RELEASE_FLOW_TARGET=${{ matrix.binary_target }} | ||
--env CARGO_MAKE_PROJECT_VERSION=${{ steps.git_describe.outputs.result }}" | ||
- name: Upload Binaries | ||
uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: '*.zip' | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
file_glob: true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ curl = "0.4" | |
curl-sys = "0.4" | ||
structopt = "0.3" | ||
chrono = "0.4" | ||
|
||
[build-dependencies] | ||
vergen = "3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
extern crate vergen; | ||
|
||
use vergen::{generate_cargo_keys, ConstantsFlags}; | ||
|
||
fn main() { | ||
let mut flags = ConstantsFlags::all(); | ||
flags.toggle(ConstantsFlags::SEMVER_FROM_CARGO_PKG); | ||
|
||
// Generate the 'cargo:' key output | ||
generate_cargo_keys(flags).expect("Unable to generate the cargo keys!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters