Skip to content

Commit

Permalink
Github Actions CI (#2)
Browse files Browse the repository at this point in the history
* Create ci.yml

* removed travis and appveyor

* build matrix

* build matrix

* build matrix

* build matrix

* do not run lints on matrix

* job dependencies

* add final build

* improve CI

* correct CI

* correct CI

* correct CI

* Continue on Error for Linting

* Publish C++

* Correct publish HPP

* Fix lib
  • Loading branch information
mattiascibien authored Jan 17, 2022
1 parent 08c42de commit c8693d5
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 194 deletions.
138 changes: 138 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Rust

on:
push:

env:
CARGO_TERM_COLOR: always

jobs:
check:
strategy:
matrix:
rust_version: [ stable, nightly, 1.49.0 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
name: Check
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v2

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

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check

test:
needs: [check]
strategy:
matrix:
rust_version: [ stable, nightly, 1.49.0 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
name: Test Suite
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v2

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

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test

lints:
needs: [check]
strategy:
matrix:
rust_version: [ stable ]
os: [ ubuntu-latest ]
name: Lints
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install ${{ matrix.rust_version }} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust_version }}
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
continue-on-error: true
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

build-cpp-sdk:
needs: [ check, test ]
strategy:
matrix:
rust_version: [ stable ]
os: [ ubuntu-latest, windows-latest, macos-latest ]

name: Build C/C++ SDK
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install ${{ matrix.rust_version }} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust_version }}
override: true
- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Publish Header
uses: actions/upload-artifact@v2
with:
name: cpp_sdk
path: target/dicenotation-ffi.hpp
- name: Publish DLL
uses: actions/upload-artifact@v2
with:
name: cpp_sdk
path: target/release/dicenotation_ffi.dll*
- name: Publish SO
uses: actions/upload-artifact@v2
with:
name: cpp_sdk
path: target/release/libdicenotation_ffi.so
- name: Publish DYLIB
uses: actions/upload-artifact@v2
with:
name: cpp_sdk
path: target/release/libdicenotation_ffi.dylib

# publish:
# needs: [ check, test ]
# name: Publish on Cargo
# if
72 changes: 0 additions & 72 deletions .travis.yml

This file was deleted.

121 changes: 0 additions & 121 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion dicenotation-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords = ["dice", "rng", "standard-dice-notation", "dice-notation"]
build = "build.rs"

[lib]
crate-type = ["dylib"]
crate-type = ["cdylib"]

[dependencies]
libc = "0.2"
Expand Down

0 comments on commit c8693d5

Please sign in to comment.