status-lib/.github/workflows/test.yml

99 lines
2.8 KiB
YAML
Raw Normal View History

name: Tests
on:
pull_request:
push:
branches:
- master
jobs:
tests:
env:
NPROC: 2
strategy:
fail-fast: false
matrix:
platform:
- {
icon: 🏁,
os: windows,
shell: msys2
}
- {
icon: 🍎,
os: macos,
shell: bash --noprofile --norc -eo pipefail
}
- {
icon: 🐧,
os: ubuntu,
shell: bash --noprofile --norc -eo pipefail
}
name: ${{ matrix.platform.icon }} ${{ matrix.platform.os }}
runs-on: ${{ matrix.platform.os }}-latest
defaults:
run:
shell: ${{ matrix.platform.shell }} {0}
steps:
Keycard initial integration (#63) * add nim-keycard-go to makefile * fix keycard-go build * add keycard.nim * remove test make task * remove debug line from makefile * fix import keycard_go * add keycard-go to .PHONY * add keycard start/stop/select methods * use https url for submodule * add KeycardApplication info and return it from select * update nim-keycard-go version * fix select return type * actually return the result * update nim-keycard-go * add keycard methods to backend * add base/mock keycard backends * imports * export keycard methods in backend * update start/stop keycard implementation * add KeycardStarted signal * fix keycard started signal * rename to KeycardConnected signal * fix keycard signal renamed * add keycardgo in makefile tasks * add back build/.gitignore * fix .gitignore * fix .gitignore * Makefile: export keycard vars * add keycard lib to nimble file * use spaces instead of tabs in non-recipe sections of Makefile * use install_name_tool on libkeycard on macOS * in GHA ubuntu environment install libpcsclite-dev with apt at start of workflow * add Keycard exceptions * remove useless test * remove useless return * move keycard types to /types * reraise exception from status/keycard.nim * remove unused import * add keycard commands: opensecure channel, pair, verify pin, export key * fix last keycard commands * add exportKey params * update nim-keycard-go Co-authored-by: Michele Balistreri <michele@bitgamma.com> Co-authored-by: Michael Bradley, Jr <michaelsbradleyjr@gmail.com>
2021-10-04 21:21:07 +00:00
- name: Install tools and libraries via APT
if: matrix.platform.os == 'ubuntu'
run: |
sudo apt install -y libpcsclite-dev
- name: Install tools and libraries via Homebrew
if: matrix.platform.os == 'macos'
run: |
brew install coreutils gawk openssl@1.1 pcre
rm -f /usr/local/opt/openssl
ln -s /usr/local/opt/openssl@1.1 /usr/local/opt/openssl
- name: Install tools and libraries via MSYS2
uses: msys2/setup-msys2@v2
if: matrix.platform.os == 'windows'
with:
msystem: UCRT64
update: true
install: >
base-devel
git
unzip
mingw-w64-ucrt-x86_64-go
mingw-w64-ucrt-x86_64-toolchain
mingw-w64-ucrt-x86_64-openssl
mingw-w64-ucrt-x86_64-pcre
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Calculate cache key from submodules tree
id: calc-cache-key
run: |
echo "::set-output name=hash::$(git submodule foreach --quiet --recursive 'git rev-parse $(git rev-parse --abbrev-ref HEAD)' | sha1sum | awk '{print $1}')"
- uses: actions/cache@v2
with:
path: |
vendor/nimbus-build-system/vendor/Nim/bin
vendor/status-go/build/bin
key: ${{ matrix.platform.os }}-${{ steps.calc-cache-key.outputs.hash }}
- name: Install and build dependencies
run: |
make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" V=1 update
make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" V=1 deps
- name: Build and run tests
# using `llvm-ar` instead of `ar` on macOS is a workaround for:
# https://github.com/nim-lang/Nim/issues/15589
run: |
if [[ ${{ matrix.platform.os }} = macos ]]; then
mkdir -p "${HOME}/.local/bin"
ln -f -s /usr/local/Cellar/llvm/*/bin/llvm-ar "${HOME}/.local/bin/ar"
export PATH="${HOME}/.local/bin:${PATH}"
fi
make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" V=1 test