-
Notifications
You must be signed in to change notification settings - Fork 14
149 lines (125 loc) · 4.21 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Main workflow
on:
pull_request:
push:
schedule:
- cron: '5 11 * * *'
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- 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@v4
- name: Build ffs/pack/unpack and run unit tests
run: |
cargo build --verbose --all --release
cargo test
- name: Integration tests for ffs and pack/unpack (Linux)
if: contains(matrix.os, 'ubuntu')
run: PATH="$(pwd)/target/release:$PATH" ./run_tests.sh
- name: Integration tests for pack/unpack only (macOS)
if: contains(matrix.os, 'macos')
run: PATH="$(pwd)/target/release:$PATH" ./run_tests.sh unpack
- name: Upload macOS release build
uses: actions/upload-artifact@v4
if: contains(matrix.os, 'macos')
with:
name: ffs.macos
path: |
target/release/ffs
target/release/pack
target/release/unpack
- name: Upload Linux release build
uses: actions/upload-artifact@v4
if: contains(matrix.os, 'ubuntu')
with:
name: ffs.linux
path: |
target/release/ffs
target/release/pack
target/release/unpack
benchmarks:
needs: build
runs-on: ubuntu-latest
steps:
- name: Install dependencies (FUSE, attr)
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
sudo apt-get install fuse libfuse-dev pkg-config attr
else
echo Unsupported RUNNER_OS=$RUNNER_OS
exit 1
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Download binaries
uses: actions/download-artifact@v4
- 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; }"
chmod +x $(pwd)/ffs.linux/ffs
PATH="$(pwd)/ffs.linux:$PATH" FFS="$(pwd)/ffs.linux/ffs" ./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 Linux benchmark data
uses: actions/upload-artifact@v4
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@v4
- name: Rename binaries
run: |
mkdir ffs
mv ffs.linux/ffs ffs/ffs.linux
mv ffs.linux/pack ffs/pack.linux
mv ffs.linux/unpack ffs/unpack.linux
if [ -d ffs.macos ]
then
mv ffs.macos/ffs ffs/ffs.macos
mv ffs.macos/pack ffs/pack.macos
mv ffs.macos/unpack ffs/unpack.macos
else
echo "macOS is disabled 😢"
fi
- 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.*
ffs/pack.*
ffs/unpack.*