Skip to content

Commit

Permalink
Replaced travis with github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ancwrd1 committed Apr 26, 2024
1 parent 15d27e3 commit e1a9602
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 20 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on: [push, pull_request]

jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- run: ci/set_rust_version.bash ${{ matrix.channel }} ${{ matrix.target }}
shell: bash
- run: ci/build.bash cargo ${{ matrix.target }}
shell: bash
- run: ci/test.bash cargo ${{ matrix.target }}
shell: bash

strategy:
fail-fast: false
matrix:
channel: [stable]
target:
- x86_64-pc-windows-msvc
- x86_64-pc-windows-gnu

macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- run: ci/set_rust_version.bash ${{ matrix.channel }} ${{ matrix.target }}
- run: ci/build.bash cargo ${{ matrix.target }}
- run: ci/test.bash cargo ${{ matrix.target }}

strategy:
fail-fast: false
matrix:
channel: [stable]
target:
- x86_64-apple-darwin

linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: ci/set_rust_version.bash ${{ matrix.channel }} ${{ matrix.target }}
- run: ci/build.bash cargo ${{ matrix.target }}
- run: ci/test.bash cargo ${{ matrix.target }}

strategy:
fail-fast: false
matrix:
channel: [stable]
target:
- x86_64-unknown-linux-gnu
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

23 changes: 23 additions & 0 deletions ci/build.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Script for building your rust projects.
set -e

source ci/common.bash

# $1 {path} = Path to cross/cargo executable
CROSS=$1
# $2 {string} = <Target Triple>
TARGET_TRIPLE=$2
# $3 {boolean} = Whether or not building for release or not.
RELEASE_BUILD=$3

required_arg $CROSS 'CROSS'
required_arg $TARGET_TRIPLE '<Target Triple>'

if [ -z "$RELEASE_BUILD" ]; then
$CROSS build --target $TARGET_TRIPLE --workspace
$CROSS build --target $TARGET_TRIPLE --all-features --workspace
else
$CROSS build --target $TARGET_TRIPLE --all-features --release --workspace
fi

6 changes: 6 additions & 0 deletions ci/common.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
required_arg() {
if [ -z "$1" ]; then
echo "Required argument $2 missing"
exit 1
fi
}
5 changes: 5 additions & 0 deletions ci/set_rust_version.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
rustup update
rustup default $1
rustup target add $2
16 changes: 16 additions & 0 deletions ci/test.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Script for building your rust projects.
set -e

source ci/common.bash

# $1 {path} = Path to cross/cargo executable
CROSS=$1
# $2 {string} = <Target Triple>
TARGET_TRIPLE=$2

required_arg $CROSS 'CROSS'
required_arg $TARGET_TRIPLE '<Target Triple>'

$CROSS test --target $TARGET_TRIPLE --workspace
$CROSS build --target $TARGET_TRIPLE --all-features --workspace
2 changes: 1 addition & 1 deletion ipp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ enum-primitive-derive = "0.3"
futures-executor = { version = "0.3", optional = true }
log = "0.4"
num-traits = "0.2"
bytes = "1"
bytes = { version = "1", features = ["serde"] }
thiserror = "1"
http = "1"
serde = { version = "1", optional = true, features = ["derive"] }
Expand Down

0 comments on commit e1a9602

Please sign in to comment.