Skip to content

Main workflow

Main workflow #1107

Workflow file for this run

name: Main workflow
on:
pull_request:
push:
schedule:
- cron: '5 11 * * *'
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
# - macos-11
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Install dependencies (FUSE, attr)
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
sudo apt-get install fuse libfuse-dev pkg-config attr
elif [ "$RUNNER_OS" = "macOS" ]; then
brew install macfuse pkg-config
else
echo Unsupported RUNNER_OS=$RUNNER_OS
exit 1
fi
- name: Checkout code
uses: actions/checkout@v2
- name: Build ffs and run unit tests
run: |
cargo build --verbose --all --release
cargo test
- name: Integration tests
run: PATH="$(pwd)/target/release:$PATH" ./run_tests.sh
- name: Install R
uses: r-lib/actions/setup-r@v2
- name: Benchmarks
run: |
Rscript -e "tries <- 0; while (!require('ggplot2') && tries < 3) { cat(sprintf('TRY %d\n', tries)); install.packages('ggplot2', repos = 'https://cloud.r-project.org/'); tries <- tries + 1; }"
PATH="$(pwd)/target/release:$PATH" ./run_bench.sh -n 3
# grab latest directory (output of run_bench)
DATADIR=bench/$(ls -ct bench/ | head -n 1)
[ -d $DATADIR ] && ls $DATADIR | grep log >/dev/null || { echo "No log files found in $DATADIR. What's going on?"; tree bench; exit 1; }
mkdir data
for x in $DATADIR/*
do
mv $x data/${x##*_}
done
- name: Upload macOS release build
uses: actions/upload-artifact@v2
if: contains(matrix.os, 'macos')
with:
name: ffs.macos
path: target/release/ffs
- name: Upload Linux release build
uses: actions/upload-artifact@v2
if: contains(matrix.os, 'ubuntu')
with:
name: ffs.linux
path: target/release/ffs
- name: Upload macOS benchmark data
uses: actions/upload-artifact@v2
if: contains(matrix.os, 'macos')
with:
name: benchmarks.macos
path: data
- name: Upload Linux benchmark data
uses: actions/upload-artifact@v2
if: contains(matrix.os, 'ubuntu')
with:
name: benchmarks.linux
path: data
prerelease:
needs: build
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Download binaries
uses: actions/download-artifact@v2
- name: Rename binaries
run: |
mkdir ffs
mv ffs.linux/ffs ffs/ffs.linux
[ -d ffs.macos ] && [ -f ffs.macos/ffs ] && ffs.macos/ffs ffs/ffs.macos || echo "macOS is disabled 😢"
- name: Deploy 'latest' release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Latest development build"
files: |
ffs/ffs.*