Skip to content

Commit

Permalink
Added CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiPolo committed Feb 6, 2021
1 parent 644a66c commit 7a7352a
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 22 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# The CI now just makes sure it builds

name: ci
on:
pull_request:
push:
branches:
- master
jobs:
build:
name: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-20.04
rust: nightly
target: x86_64-unknown-linux-gnu
- build: macos
os: macos-latest
rust: nightly
target: x86_64-apple-darwin
- build: windows
os: windows-2019
rust: nightly
target: x86_64-pc-windows-msvc

steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 1

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

- name: Use Cross
if: matrix.target != ''
run: |
cargo install cross
echo "CARGO=cross" >> $GITHUB_ENV
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
- name: Install musl-gcc for backtrace-sys and openssl dev not sure why.
if: matrix.build == 'linux'
run: sudo apt-get install musl-tools pkg-config libssl-dev

- name: Install openssl on MacOS
if: matrix.build == 'macos'
run: brew install openssl

- name: Set Openssl directory for Windows
# Because it is installed there already https://github.com/actions/virtual-environments/issues/371
if: matrix.build == 'windows'
run: set OPENSSL_DIR="C:\Program Files\OpenSSL"

- name: Set TARGET flags
run: echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV

- name: Build release binary
run: cargo build --release ${{ env.TARGET_FLAGS }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-18.04
os: ubuntu-20.04
rust: nightly
target: x86_64-unknown-linux-gnu
- build: macos
Expand Down
42 changes: 21 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7a7352a

Please sign in to comment.