Use composite actions in CI (#65)

* Attempt composite actions in CI

* Remove needs monero-daemon for the action

* Correct actions folder layout

* Remove empty inputs/outputs, add shell

* Try moving env declaration spot

* Remove usage of env

* Cached Rust composite action

* Replace [] with ""

Remove empty outputs
This commit is contained in:
Luke Parker
2022-07-23 06:05:31 -05:00
committed by GitHub
parent bb3ffa9021
commit 18a1d15f78
4 changed files with 103 additions and 92 deletions

View File

@@ -0,0 +1,25 @@
name: build-dependencies
description: Installs build dependencies for Serai
runs:
using: "composite"
steps:
- name: Install solc
shell: bash
run: |
pip3 install solc-select
solc-select install 0.8.9
solc-select use 0.8.9
- name: Install Monero Dependencies
shell: bash
run: |
sudo apt update
sudo apt install build-essential libboost-all-dev libsodium-dev
- name: Install WASM toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
target: wasm32-unknown-unknown

32
.github/actions/cached-rust/action.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: cached-rust
description: Installs Rust, caching ~/.cargo and ./target
inputs:
toolchain:
description: "Toolchain to install"
required: false
default: stable
components:
description: "Components to install"
required: false
default:
runs:
using: "composite"
steps:
- name: Rust cache
uses: actions/cache@v3
with:
path: |
~/.cargo
./target
key: ${{ runner.os }}-${{ runner.arch }}-rust-${{ inputs.toolchain }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ inputs.toolchain }}
profile: minimal
default: true
components: ${{ inputs.components }}

38
.github/actions/monero/action.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: monero-regtest
description: Spawns a regtest Monero daemon
runs:
using: "composite"
steps:
- name: Monero daemon cache
id: cache-monerod
uses: actions/cache@v3
with:
path: monerod
key: monerod-${{ runner.os }}-${{ runner.arch }}-v0.17.3.2
- name: Download the Monero Daemon
if: steps.cache-monerod.outputs.cache-hit != 'true'
# Calculates OS/ARCH to demonstrate it, yet then locks to linux-x64 due
# to the contained folder not following the same naming scheme and
# requiring further expansion not worth doing right now
shell: bash
run: |
RUNNER_OS=${{ runner.os }}
RUNNER_ARCH=${{ runner.arch }}
RUNNER_OS=${RUNNER_OS,,}
RUNNER_ARCH=${RUNNER_ARCH,,}
RUNNER_OS=linux
RUNNER_ARCH=x64
FILE=monero-$RUNNER_OS-$RUNNER_ARCH-v0.17.3.2.tar.bz2
wget https://downloads.getmonero.org/cli/$FILE
tar -xvf $FILE
mv monero-x86_64-linux-gnu-v0.17.3.2/monerod monerod
- name: Monero Regtest Daemon
shell: bash
run: ./monerod --regtest --offline --fixed-difficulty=1 --detach