Skip to content

Commit

Permalink
Vendored Openssl (#87)
Browse files Browse the repository at this point in the history
This PR looks to build Foreman with a vendored openssl
  • Loading branch information
afujiwara-roblox authored Nov 3, 2023
1 parent f5dde74 commit d84d69a
Show file tree
Hide file tree
Showing 9 changed files with 247 additions and 194 deletions.
146 changes: 74 additions & 72 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,106 +3,108 @@ name: CI
on:
push:
branches:
- main
- main

pull_request:
branches:
- main
- main

jobs:
checks:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Setup Rust toolchain
shell: bash
run: rustup default stable
- name: Setup Rust toolchain
shell: bash
run: rustup default stable

- name: Rustfmt
shell: bash
run: cargo fmt -- --check
- name: Rustfmt
shell: bash
run: cargo fmt -- --check

- name: Clippy
shell: bash
run: cargo clippy
- name: Clippy
shell: bash
run: cargo clippy

build:
needs: checks
timeout-minutes: 15
timeout-minutes: 20
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
rust_version: [stable, "1.66.0"]
os: [windows-latest, ubuntu-latest]
rust_version: [stable, "1.66.0"]

runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Setup Rust toolchain
shell: bash
run: rustup default ${{ matrix.rust_version }}
- uses: actions/checkout@v2

- name: Build
shell: bash
run: cargo build --locked --verbose
- name: Setup Rust toolchain
run: rustup default ${{ matrix.rust_version }}

- name: Run tests
shell: bash
run: cargo test --locked --verbose
- name: Build
run: cargo build --locked --verbose

end-to-end-tests:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
- name: Run tests
run: cargo test --locked --verbose

runs-on: ${{ matrix.os }}
end-to-end-tests-ubuntu:
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v2

- name: End-to-end tests
shell: bash
run: |
cargo install --path .
foreman --version
PATH=$PATH:~/.foreman/bin
./scripts/end-to-end-tests.sh
kill-process-test-unix:
strategy:
matrix:
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
- uses: actions/checkout@v2

- name: End-to-end tests ubuntu
shell: bash
run: |
cargo install --path .
foreman --version
PATH=$PATH:~/.foreman/bin
./scripts/end-to-end-tests.sh
end-to-end-tests-windows:
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v2

- name: kill-process-test-unix
shell: bash
run: |
cargo install --path .
foreman --version
PATH=$PATH:~/.foreman/bin
./scripts/kill-process-test-unix.sh
kill-process-test-windows:
strategy:
matrix:
os: [windows-latest]
runs-on: ${{ matrix.os }}
- uses: actions/checkout@v2

- name: install foreman from source
shell: pwsh
run: |
cargo install --path .
foreman --version
- name: End-to-end tests windows
shell: bash
run: |
PATH=$PATH:~/.foreman/bin
./scripts/end-to-end-tests.sh
kill-process-test-unix:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: kill-process-test-windows
shell: pwsh
run: |
cargo install --path .
foreman --version
$env:Path += '%USERPROFILE%/.foreman/bin'
.\scripts\kill-process-test-windows.ps1
- name: kill-process-test-unix
shell: bash
run: |
cargo install --path .
foreman --version
PATH=$PATH:~/.foreman/bin
./scripts/kill-process-test-unix.sh
kill-process-test-windows:
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v2

- name: kill-process-test-windows
shell: pwsh
run: |
cargo install --path .
foreman --version
$env:Path += '%USERPROFILE%/.foreman/bin'
.\scripts\kill-process-test-windows.ps1
19 changes: 19 additions & 0 deletions .github/workflows/openssl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -x
set -e

OPENSSL_VER=${OPENSSL_VER:-openssl-1.1.1n}
OPENSSL_DST=${PWD}/${OPENSSL_VER}-install

if [[ ! -d ${OPENSSL_DST} ]]; then
curl -O https://www.openssl.org/source/${OPENSSL_VER}.tar.gz
tar xzf ${OPENSSL_VER}.tar.gz
cd ${OPENSSL_VER}
./Configure no-shared enable-rc5 zlib darwin64-arm64-cc --prefix=${OPENSSL_DST} --openssldir=${OPENSSL_DST}
make -j2
make install
cd -
fi

export OPENSSL_DIR=${OPENSSL_DST}
Loading

0 comments on commit d84d69a

Please sign in to comment.