Skip to content

Extract platform-specific random device #5

Extract platform-specific random device

Extract platform-specific random device #5

Workflow file for this run

name: Rust
on:
pull_request:
push:
branches: ["main"]
release:
types: [published]
env:
CARGO_TERM_COLOR: always
jobs:
style:
name: Check Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
profile: minimal
override: true
- name: Format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
test:
name: Test
needs: [style]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all --lib
deploy_linux:
name: Deploy Linux
needs: [test]
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest
strategy:
matrix:
target:
[
x86_64-unknown-linux-gnu,
aarch64-unknown-linux-gnu,
arm-unknown-linux-gnueabihf,
]
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 target
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }}
- name: Package
shell: bash
run: |
tar -czvf picorng-${{ matrix.target }}.tar.gz -C target/${{ matrix.target }}/release/ picorng
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "picorng*"
deploy_macos:
name: Deploy macOS
needs: [test]
if: ${{ github.event_name == 'release' }}
runs-on: macos-latest
strategy:
matrix:
target: [x86_64-apple-darwin, aarch64-apple-darwin]
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 target
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }}
- name: Package
shell: bash
run: |
tar -czvf picorng-${{ matrix.target }}.tar.gz -C target/${{ matrix.target }}/release/ picorng
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "picorng*"