Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rust.yml #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 42 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,53 @@
name: Rust

on: [push]
on:
push:
release:
types: [created]
pull_request:
branches: [ master ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest
name: Build Rust with Cargo
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable, nightly]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Build
run: cargo build --verbose
- name: Build examples
run: cargo build --examples --verbose
- name: Run tests
run: cargo test --verbose

build_success:
name: Build Rust with Cargo - All environments
runs-on: ubuntu-latest
needs: build
steps:
- run: echo Done!

publish:
name: Publish tagged release on crates.io
if: github.event_name == 'release' && github.event.action == 'created'
needs:
- build_success
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: katyo/publish-crates@v1
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}