nim-sqlcipher/.github/workflows/test.yml

140 lines
5.7 KiB
YAML

name: Tests
on:
pull_request:
push:
branches:
- master
jobs:
tests:
strategy:
matrix:
env:
- { NPROC: 2 }
platform: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
env: ${{ matrix.env }}
name: ${{ matrix.platform }} - ${{ matrix.env.NPROC }} processes
steps:
- name: Link Homebrew OpenSSL 1.1 to /usr/local/opt/openssl
if: startsWith(matrix.platform, 'macos')
shell: bash
run: |
rm -f /usr/local/opt/openssl
ln -s /usr/local/opt/openssl@1.1 /usr/local/opt/openssl
- name: Install Scoop
if: startsWith(matrix.platform, 'windows')
shell: powershell
run: |
iwr -useb get.scoop.sh | iex
- name: Install external dependencies with Scoop
if: startsWith(matrix.platform, 'windows')
shell: bash
run: |
export PATH="${PATH}:${HOME}/scoop/shims"
scoop install openssl-mingw
- name: Checkout code
uses: actions/checkout@v2
# We need to do this because of how github cache works
- name: Initialize submodules
shell: bash
run: |
git submodule update --init --recursive
- name: Cache Nim compiler
uses: actions/cache@v2
with:
path: |
vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ runner.os }}-${{ matrix.env.NPROC }}-nim-${{ hashFiles('.gitmodules') }}
- name: Install and build dependencies
shell: bash
run: |
[[ ${{ matrix.platform }} = windows* ]] && export PATH="${PATH}:${HOME}/scoop/shims"
export M="$(which mingw32-make || echo make)"
"${M}" -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" V=1 update
"${M}" -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" V=1 deps
- name: Build the sqlite.nim wrapper and run tests (static)
shell: bash
run: |
[[ ${{ matrix.platform }} = macos* ]] && \
export SSL_INCLUDE_DIR=/usr/local/opt/openssl/include && \
export SSL_LIB_DIR=/usr/local/opt/openssl/lib
[[ ${{ matrix.platform }} = windows* ]] && \
export PATH="${PATH}:${HOME}/scoop/shims" && \
export SSL_INCLUDE_DIR="${HOME}/scoop/apps/openssl-mingw/current/include" && \
export SSL_LIB_DIR="${HOME}/scoop/apps/openssl-mingw/current/lib"
export M="$(which mingw32-make || echo make)"
"${M}" -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" \
SSL_INCLUDE_DIR="${SSL_INCLUDE_DIR}" \
SSL_LIB_DIR="${SSL_LIB_DIR}" \
V=1 \
test
- name: Build the sqlite.nim wrapper and run tests (shared)
shell: bash
run: |
rm -rf nimcache sqlcipher sqlite test/build
[[ ${{ matrix.platform }} = macos* ]] && \
export SSL_INCLUDE_DIR=/usr/local/opt/openssl/include && \
export SSL_LIB_DIR=/usr/local/opt/openssl/lib
[[ ${{ matrix.platform }} = windows* ]] && \
export PATH="${PATH}:${HOME}/scoop/shims" && \
export SSL_INCLUDE_DIR="${HOME}/scoop/apps/openssl-mingw/current/include" && \
export SSL_LIB_DIR="${HOME}/scoop/apps/openssl-mingw/current/lib"
export M="$(which mingw32-make || echo make)"
"${M}" -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" \
SQLITE_STATIC=false \
SSL_INCLUDE_DIR="${SSL_INCLUDE_DIR}" \
SSL_LIB_DIR="${SSL_LIB_DIR}" \
SSL_STATIC=false \
V=1 \
test
- name: "Build the sqlite.nim wrapper and run tests (mixed: shared SQLITE)"
shell: bash
run: |
rm -rf nimcache sqlcipher sqlite test/build
[[ ${{ matrix.platform }} = macos* ]] && \
export SSL_INCLUDE_DIR=/usr/local/opt/openssl/include && \
export SSL_LIB_DIR=/usr/local/opt/openssl/lib
[[ ${{ matrix.platform }} = windows* ]] && \
export PATH="${PATH}:${HOME}/scoop/shims" && \
export SSL_INCLUDE_DIR="${HOME}/scoop/apps/openssl-mingw/current/include" && \
export SSL_LIB_DIR="${HOME}/scoop/apps/openssl-mingw/current/lib"
export M="$(which mingw32-make || echo make)"
"${M}" -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" \
SQLITE_STATIC=false \
SSL_INCLUDE_DIR="${SSL_INCLUDE_DIR}" \
SSL_LIB_DIR="${SSL_LIB_DIR}" \
V=1 \
test
- name: "Build the sqlite.nim wrapper and run tests (mixed: shared SSL)"
shell: bash
run: |
rm -rf nimcache sqlcipher sqlite test/build
[[ ${{ matrix.platform }} = macos* ]] && \
export SSL_INCLUDE_DIR=/usr/local/opt/openssl/include && \
export SSL_LIB_DIR=/usr/local/opt/openssl/lib
[[ ${{ matrix.platform }} = windows* ]] && \
export PATH="${PATH}:${HOME}/scoop/shims" && \
export SSL_INCLUDE_DIR="${HOME}/scoop/apps/openssl-mingw/current/include" && \
export SSL_LIB_DIR="${HOME}/scoop/apps/openssl-mingw/current/lib"
export M="$(which mingw32-make || echo make)"
"${M}" -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" \
SSL_INCLUDE_DIR="${SSL_INCLUDE_DIR}" \
SSL_LIB_DIR="${SSL_LIB_DIR}" \
SSL_STATIC=false \
V=1 \
test