Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CI and the nightly release work on Windows #127

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ jobs:
name: Compile and Test
strategy:
matrix:
os:
- ubuntu-18.04
- macos-latest
# Note: we need to use pre-compiled TensorFlow Lite binaries on
# Windows, so ignore the Windows build for now
#- windows-latest
include:
- name: linux
os: ubuntu-18.04
setup_script: scripts/ci_setup.linux.sh
- name: windows
os: windows-latest
setup_script: scripts/ci_setup.windows.ps1
- name: macos
os: macos-latest
setup_script: scripts/ci_setup.macos.sh
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand All @@ -28,14 +32,16 @@ jobs:
target
python/target
key: ${{ runner.os }}-${{ github.workflow }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
- name: Update Rustup
run: |
# We need to update rustup because the mac version is out of date and
# self-update is disabled. https://github.com/rust-lang/rustup/issues/2766
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none -y
if: runner.os == 'macOS'
- name: Setup Rust
run: rustup show
# We need to explicitly install clang and record where libclang is
# https://github.com/rust-lang/rust-bindgen/issues/1797
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "11.0"
directory: ${{ runner.temp }}/llvm
if: runner.os == 'Windows'
- name: Setup Environment
run: ${{ matrix.setup_script }}
- name: Type Check
uses: actions-rs/cargo@v1
with:
Expand Down Expand Up @@ -68,14 +74,8 @@ jobs:
~/.cargo/git
target
key: ${{ runner.os }}-${{ github.workflow }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
- name: Update Rustup
run: |
# We need to update rustup because the mac version is out of date and
# self-update is disabled. https://github.com/rust-lang/rustup/issues/2766
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none -y
if: runner.os == 'macOS'
- name: Setup Rust
run: rustup show
- name: Setup
run: scripts/ci_setup.linux.sh
- name: Generate API Docs
id: first_try
uses: actions-rs/cargo@v1
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ jobs:
os: ubuntu-18.04
artifact_name: "target/rune.*.zip"
asset_name: rune-linux
# - name: windows
# os: windows-latest
# artifact_name: "target/rune.*.zip"
# asset_name: rune-windows
setup_script: scripts/ci_setup.linux.sh
- name: windows
os: windows-latest
artifact_name: "target/rune.*.zip"
asset_name: rune-windows
setup_script: scripts/ci_setup.windows.ps1
- name: macos
os: macos-latest
artifact_name: "target/rune.*.zip"
asset_name: rune-macos
setup_script: scripts/ci_setup.macos.sh
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v2
Expand All @@ -63,12 +66,16 @@ jobs:
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-${{ github.workflow }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
- name: Setup Rust
run: |
rustup default nightly-2021-05-09
rustup target add wasm32-unknown-unknown
rustc --version --verbose
rustup show
# We need to explicitly install clang and record where libclang is
# https://github.com/rust-lang/rust-bindgen/issues/1797
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "11.0"
directory: ${{ runner.temp }}/llvm
if: runner.os == 'Windows'
- name: Setup Environment
run: ${{ matrix.setup_script }}
- name: Build
run: cargo xtask dist
env:
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions scripts/ci_setup.linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -xe

rustup show
rustc --version --verbose
cargo --version --verbose
12 changes: 12 additions & 0 deletions scripts/ci_setup.macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

set -xe

# We need to update rustup because the mac version is out of date and
# self-update is disabled. https://github.com/rust-lang/rustup/issues/2766
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none -y
# Make sure rust is on our path
source ~/.cargo/env

# and now we can do the linux setup like normal
exec "$(git rev-parse --show-toplevel)/scripts/ci_setup.linux.sh"
11 changes: 11 additions & 0 deletions scripts/ci_setup.windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Note: in order to compile Rune on Windows we need to explicitly install clang
# and record where libclang is.
# https://github.com/rust-lang/rust-bindgen/issues/1797

echo "LIBCLANG_PATH=$((gcm clang).source -replace 'clang.exe')" >> $env:GITHUB_ENV
# tflite needs C++14 or higher to generate STL bindings
echo "BINDGEN_EXTRA_CLANG_ARGS=-std=c++17" >> $env:GITHUB_ENV

rustup show
rustc --version --verbose
cargo --version --verbose
0 util/rune.sh → scripts/rune.sh
100644 → 100755
File renamed without changes.