2023-03-04 11:23:40 +03:00
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: rust/ares
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-05-20 17:22:21 +03:00
|
|
|
runs-on: 'ubuntu-latest'
|
2023-03-04 11:23:40 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2023-05-20 21:50:25 +03:00
|
|
|
# Makes it easier to determine why CI might differ from local linter/build
|
|
|
|
#
|
|
|
|
- name: Version
|
|
|
|
run: rustc --version
|
|
|
|
|
2023-03-04 11:23:40 +03:00
|
|
|
- name: Format
|
|
|
|
run: cargo fmt --check
|
|
|
|
|
2023-09-25 20:08:49 +03:00
|
|
|
# Install third-party dependencies
|
|
|
|
#
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2023-09-26 23:07:27 +03:00
|
|
|
# install apt packages
|
2023-09-25 20:08:49 +03:00
|
|
|
sudo apt-get install -y \
|
|
|
|
libcrypto++-dev \
|
|
|
|
openssl \
|
|
|
|
cmake \
|
|
|
|
libsecp256k1-dev &&
|
2023-09-26 23:07:27 +03:00
|
|
|
|
|
|
|
# install libaes_siv
|
2023-09-25 20:08:49 +03:00
|
|
|
git clone https://github.com/dfoxfranke/libaes_siv.git &&
|
|
|
|
cd libaes_siv &&
|
|
|
|
cmake . &&
|
|
|
|
make &&
|
|
|
|
sudo make install
|
|
|
|
|
2023-09-26 23:07:27 +03:00
|
|
|
# install urcrypt
|
|
|
|
cd .. &&
|
|
|
|
git clone https://github.com/urbit/urcrypt.git &&
|
|
|
|
cd urcrypt &&
|
|
|
|
./autogen.sh &&
|
|
|
|
./configure --enable-shared &&
|
|
|
|
make &&
|
|
|
|
sudo make install
|
|
|
|
|
2023-05-20 21:47:04 +03:00
|
|
|
# See clippy linter docs: https://github.com/rust-lang/rust-clippy
|
|
|
|
#
|
2023-05-20 21:50:25 +03:00
|
|
|
# First linter is set to fail for all warnings, then ignored warnings are
|
|
|
|
# explicitly listed
|
2023-05-20 21:47:04 +03:00
|
|
|
#
|
2023-03-14 18:37:12 +03:00
|
|
|
- name: Lint
|
2023-05-20 21:47:04 +03:00
|
|
|
run: |
|
|
|
|
cargo clippy \
|
|
|
|
--all-targets \
|
|
|
|
--no-deps \
|
|
|
|
-- -D warnings \
|
|
|
|
-A clippy::missing_safety_doc
|
2023-03-14 18:37:12 +03:00
|
|
|
|
2023-03-04 11:23:40 +03:00
|
|
|
- name: Build
|
2023-10-11 06:55:47 +03:00
|
|
|
run: cargo build --release --verbose --features check_all
|
2023-03-04 11:23:40 +03:00
|
|
|
|
|
|
|
- name: Run tests
|
2023-08-16 01:11:23 +03:00
|
|
|
run: cargo test --verbose -- --test-threads=1
|