Skip to content

Commit

Permalink
fixup! Windows :/
Browse files Browse the repository at this point in the history
  • Loading branch information
danielabrozzoni committed Sep 24, 2021
1 parent 3f1a2b2 commit ca919ef
Showing 1 changed file with 134 additions and 70 deletions.
204 changes: 134 additions & 70 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,71 +3,87 @@ name: CI
on: [pull_request]

jobs:
tests:
strategy:
matrix:
toolchain:
- nightly
- 1.43
os:
- ubuntu-latest
- macOS-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust ${{ matrix.toolchain }} toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
profile: minimal
- name: Build on Rust ${{ matrix.toolchain }} default features
# We can't compile tor on windows, cross-compile only :)
if: matrix.os == 'windows-latest'
run: cargo build --verbose --color always
- name: Build on Rust ${{ matrix.toolchain }} all features
if: matrix.os != 'windows-latest'
run: cargo build --all-features --verbose --color always
- name: Test on Rust ${{ matrix.toolchain }} default features
# We can't compile tor on windows, cross-compile only :)
if: matrix.os == 'windows-latest'
run: cargo test --verbose --color always
- name: Test on Rust ${{ matrix.toolchain }} all features
if: matrix.os != 'windows-latest'
run: cargo test --all-features --verbose --color always
- name: Fuzz
if: matrix.os == 'ubuntu-latest' && matrix.toolchain == 'nightly'
run: ./fuzz/run.sh

windows-tor-cross-compile:
strategy:
matrix:
toolchain:
- nightly
- 1.43
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust ${{ matrix.toolchain }} toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: x86_64-pc-windows-gnu
override: true
profile: minimal
- name: Install MingW
run: sudo apt-get update && sudo apt-get install -y mingw-w64
- name: Cross-compile for Windows
run: cargo build --all-features --verbose --color always --target x86_64-pc-windows-gnu

# linux-tests:
# strategy:
# matrix:
# toolchain:
# - nightly
# - 1.43
# runs-on: ubuntu-latest
# steps:
# - name: Checkout source code
# uses: actions/checkout@v2
# - name: Install Rust ${{ matrix.toolchain }} toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: ${{ matrix.toolchain }}
# override: true
# profile: minimal
# # We need to download Tor for the tests. Notice that it's not
# # needed if you don't run the tests
# - name: Download Tor
# run: sudo apt-get install -y tor
# - name: Build on Rust ${{ matrix.toolchain }}
# run: cargo build --all-features --verbose --color always
# - name: Test on Rust ${{ matrix.toolchain }}
# run: cargo test --all-features --verbose --color always
# - name: Fuzz
# if: matrix.toolchain == 'nightly'
# run: ./fuzz/run.sh
#
# macos-tests:
# strategy:
# matrix:
# toolchain:
# - nightly
# - 1.43
# runs-on: macOS-latest
# steps:
# - name: Checkout source code
# uses: actions/checkout@v2
# - name: Install Rust ${{ matrix.toolchain }} toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: ${{ matrix.toolchain }}
# override: true
# profile: minimal
# # We need to download Tor for the tests. Notice that it's not
# # needed if you don't run the tests
# - name: Download deps
# run: brew install tor autoconf
# - name: Build on Rust ${{ matrix.toolchain }}
# run: cargo build --all-features --verbose --color always
# - name: Test on Rust ${{ matrix.toolchain }}
# run: cargo test --all-features --verbose --color always
#
# windows-tests:
# strategy:
# matrix:
# toolchain:
# #- nightly
# - nightly
# - 1.43
# runs-on: windows-latest
# steps:
# - name: Checkout source code
# uses: actions/checkout@v2
# - name: Install Rust ${{ matrix.toolchain }} toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: ${{ matrix.toolchain }}
# override: true
# profile: minimal
# - name: Build on Rust ${{ matrix.toolchain }}
# # We can't compile tor on windows, cross-compile only :)
# run: cargo build --verbose --color always
# - name: Test on Rust ${{ matrix.toolchain }}
# # We can't compile tor on windows, cross-compile only :)
# run: cargo test --verbose --color always

# windows-tests-full:
# strategy:
# matrix:
# toolchain:
# - nightly
# - 1.43
# runs-on: windows-latest
# steps:
Expand All @@ -80,29 +96,77 @@ jobs:
# with:
# toolchain: ${{ matrix.toolchain }}
# target: x86_64-pc-windows-gnu
# override: true
# #override: true
# profile: minimal
# - name: Debug
# run: rustup show
# # libsodium build.rs is broken: https://github.com/sodiumoxide/sodiumoxide/issues/377
# - name: Fix libsodium compilation
# run: rustup default stable-gnu
# #rustup set default-host x86_64-pc-windows-gnu
# - name: Fix libsodium compilation again
# run: rustup set default-host x86_64-pc-windows-gnu
# - name: Debug
# run: rustup show
# - name: Build on Rust ${{ matrix.toolchain }}
# run: cargo build -vv --color always --all-features
# - name: Test on Rust ${{ matrix.toolchain }}
# run: cargo test --all-features --verbose --color always

rustfmt_check:
windows-tests-full:
strategy:
matrix:
toolchain:
#- nightly
- 1.43
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust ${{ matrix.toolchain }} toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
override: true
- run: cargo fmt -- --check
toolchain: ${{ matrix.toolchain }}
target: x86_64-pc-windows-gnu
override: true
profile: minimal
- name: Install toolchain
run: sudo apt-get update && sudo apt-get install -y mingw-w64 tar
- name: Debug
run: rustup show
- name: Find libsodium
run: export SODIUM_LIB_DIR=$(find ~/.cargo/registry -name libsodium.a | grep libsodium-sys-0.2.7 | grep mingw/win64)
- name: Debug
run: find $HOME/.cargo/registry -name libsodium.a
- name: Debug2
run: ls $HOME/.cargo/registry
- name: Debug3
run: wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-mingw.tar.gz && tar xvf libsodium-1.0.18-mingw.tar.gz
- name: Find libsodium
run: export SODIUM_LIB_DIR=$PWD/libsodium-1.0.18-mingw/libsodium-win64/lib/libsodium.a
- name: Debug4
run: ls $SODIUM_LIB_DIR
- name: Debug5
run: echo $SODIUM_LIB_DIR
# libsodium build.rs is broken: https://github.com/sodiumoxide/sodiumoxide/issues/377
# - name: Install target toolchain
# - name: Fix libsodium compilation
# run: rustup default stable-gnu
# - name: Fix libsodium compilation again
# run: rustup set default-host x86_64-pc-windows-gnu
# - name: Debug
# run: rustup show
- name: Build on Rust ${{ matrix.toolchain }}
run: SODIUM_LIB_DIR=$PWD/libsodium-1.0.18-mingw/libsodium-win64/lib/ cargo build -vv --color always --all-features --target x86_64-pc-windows-gnu -j 1
#run: SODIUM_LIB_DIR=$(find ~/.cargo/registry -name libsodium.a | grep libsodium-sys-0.2.7 | grep mingw/win64) cargo build -vv --color always --all-features --target x86_64-pc-windows-gnu -j 1

# rustfmt_check:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v1
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# components: rustfmt
# override: true
# - run: cargo fmt -- --check
#

0 comments on commit ca919ef

Please sign in to comment.