mirror of
https://github.com/urbit/ares.git
synced 2024-11-26 20:58:02 +03:00
77 lines
2.0 KiB
YAML
77 lines
2.0 KiB
YAML
on:
|
|
workflow_call:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: rust/ares
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: 'ubuntu-latest'
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
# Install nix, required by nix-shell-action
|
|
- uses: cachix/install-nix-action@v23
|
|
name: Install Nix
|
|
with:
|
|
extra_nix_config: "extra-experimental-features = nix-command flakes"
|
|
|
|
# Check formatting
|
|
- name: Format
|
|
run: |
|
|
nix develop --command bash -c "cargo fmt --check"
|
|
|
|
# Install third-party dependencies
|
|
#
|
|
- name: Install dependencies
|
|
run: |
|
|
# install apt packages
|
|
sudo apt-get install -y \
|
|
autoconf-archive \
|
|
libcrypto++-dev \
|
|
openssl \
|
|
cmake \
|
|
libsecp256k1-dev &&
|
|
|
|
# install libaes_siv
|
|
git clone https://github.com/dfoxfranke/libaes_siv.git &&
|
|
cd libaes_siv &&
|
|
cmake . &&
|
|
make &&
|
|
sudo make install
|
|
|
|
# install urcrypt
|
|
cd .. &&
|
|
git clone https://github.com/urbit/urcrypt.git &&
|
|
cd urcrypt &&
|
|
./autogen.sh &&
|
|
./configure --enable-shared &&
|
|
make &&
|
|
sudo make install
|
|
|
|
# See clippy linter docs: https://github.com/rust-lang/rust-clippy
|
|
#
|
|
# First linter is set to fail for all warnings, then ignored warnings are
|
|
# explicitly listed
|
|
#
|
|
# XX TODO make a script with all the flags for the linter
|
|
- name: Lint
|
|
run: |
|
|
nix develop --command bash -c "cargo clippy --all-targets --no-deps -- -D warnings -A clippy::missing_safety_doc"
|
|
|
|
# Build Ares
|
|
- name: Build
|
|
run: |
|
|
nix develop --command bash -c "cargo build --release --verbose --features check_all"
|
|
|
|
# Run tests
|
|
- name: Test
|
|
run: |
|
|
nix develop --command bash -c "cargo test --verbose -- --test-threads=1"
|
|
|