Skip to content

Commit

Permalink
Add Github workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexhuszagh committed Sep 3, 2021
1 parent 0cf30a0 commit 35405f4
Show file tree
Hide file tree
Showing 13 changed files with 345 additions and 123 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/Cross.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Cross

on:
pull_request:
branches: [main]
workflow_dispatch:

jobs:
cross:
name: Rust ${{matrix.target}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
# Android
- aarch64-linux-android
- arm-linux-androideabi
- armv7-linux-androideabi
- i686-linux-android
- x86_64-linux-android

# Linux
- aarch64-unknown-linux-gnu
- arm-unknown-linux-gnueabi
- 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
- powerpc64le-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl

# Windows
- x86_64-pc-windows-gnu

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{matrix.target}}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: check
args: --target ${{matrix.target}}
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --target ${{matrix.target}}
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --target ${{matrix.target}} --features=compact

notest:
name: Rust ${{matrix.target}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
# Linux
- powerpc64-unknown-linux-gnu
- s390x-unknown-linux-gnu

# FreeBSD
- i686-unknown-freebsd
- x86_64-unknown-freebsd
- x86_64-unknown-netbsd

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{matrix.target}}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: check
args: --target ${{matrix.target}}
23 changes: 23 additions & 0 deletions .github/workflows/Features.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Features

on:
pull_request:
branches: [main]
workflow_dispatch:

jobs:
features:
name: Test Feature Combinations
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- run: ci/test.sh
- run: NIGHTLY=1 NO_STD=1 ci/test.sh
40 changes: 40 additions & 0 deletions .github/workflows/OSX.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: OSX

on:
pull_request:
branches: [main]
workflow_dispatch:

jobs:
cross:
name: Rust ${{matrix.target}}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
target:
# iOS targets don't work, since rust-embedded doesn't provide images.
- x86_64-apple-darwin

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{matrix.target}}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: check
args: --target ${{matrix.target}}
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --target ${{matrix.target}}
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --target ${{matrix.target}} --features=compact
41 changes: 41 additions & 0 deletions .github/workflows/Simple.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Simple

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
name: Rust ${{matrix.rust}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [1.51.0, stable, beta, nightly]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- run: cargo check
- run: cargo test
- run: cargo test --features=compact

check:
name: Lint code
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- run: ci/check.sh
24 changes: 24 additions & 0 deletions .github/workflows/Valgrind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Valgrind

on:
pull_request:
branches: [main]
workflow_dispatch:

jobs:
valgrind:
name: Valgrind Tests
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- run: sudo apt-get install valgrind
- run: cargo +nightly install cargo-valgrind
- run: cargo +nightly valgrind test --release
- run: cargo +nightly valgrind test --all-features --release
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ repository = "https://github.com/Alexhuszagh/minimal-lexical"
version = "0.1.2"
exclude = [
"ci/*",
"docs/*",
"etc/*",
"examples/*",
"scripts/*"
Expand Down
7 changes: 0 additions & 7 deletions ci/README.md

This file was deleted.

11 changes: 11 additions & 0 deletions ci/check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# Check our code passes formatting and lint checks.

set -ex

# Change to our project home.
script_dir=`dirname "${BASH_SOURCE[0]}"`
cd "$script_dir"/..

scripts/check.sh
RUSTFLAGS="--deny warnings" cargo +nightly build --features=lint
22 changes: 22 additions & 0 deletions ci/comprehensive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# Run a small subset of our comprehensive test suite.

set -ex

# Print our cargo version, for debugging.
cargo --version

# Change to our project home.
script_dir=`dirname "${BASH_SOURCE[0]}"`
script_home=`realpath "$script_dir"`
cd "$script_home"/..

FEATURES=
if [ ! -z $ALL_FEATURES ]; then
FEATURES=--all-features
fi

# Test the parse-float correctness tests
cd etc/correctness
cargo run $FEATURES --release --bin test-parse-golang
cargo run $FEATURES --release --bin test-parse-unittests
56 changes: 0 additions & 56 deletions ci/install_rust.sh

This file was deleted.

60 changes: 0 additions & 60 deletions ci/script.sh

This file was deleted.

Loading

0 comments on commit 35405f4

Please sign in to comment.