Skip to content

Commit

Permalink
Add compile test
Browse files Browse the repository at this point in the history
  • Loading branch information
YunhuiChen committed Mar 19, 2024
1 parent 0aa7ed5 commit 45577b9
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/scripts/build_kernel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
set -e
wget -O linux.tar.gz https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.9.tar.gz
sudo apt-get install bison flex libelf-dev bc -y
mkdir t
cd t
tar xzf ../linux.tar.gz
cd linux*
make defconfig
make -j`grep -c processor /proc/cpuinfo`
cd ..
if ! rm -rv linux* ; then
echo "uh oh rm -r failed, it left behind:"
find .
exit 1
fi
cd ..
rm -rv t linux*
100 changes: 100 additions & 0 deletions .github/workflows/compile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: "compile"

on:
push:
branches:
- main
- release**
paths:
- '**/compile.yml'
pull_request:
branches:
- main
- release**
paths:
- '**/compile.yml'
schedule:
- cron: '0 20 * * *'
workflow_dispatch:
inputs:
debug:
type: boolean
description: "Run the build with tmate debugging enabled"
required: false
default: false

jobs:
compile:
timeout-minutes: 300
strategy:
fail-fast: false
matrix:
app: [ 'kernel']
# app: [ 'gcc','kernel']
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Build
timeout-minutes: 10
uses: ./.github/actions/build

- name: Run Redis
run: |
sudo docker run -d --name redis -v redis-data:/data \
-p 6379:6379 redis redis-server --appendonly yes
- name: Setup minio
run: |
docker run -d -p 9000:9000 --name minio \
-e "MINIO_ACCESS_KEY=minioadmin" \
-e "MINIO_SECRET_KEY=minioadmin" \
-v /tmp/data:/data \
-v /tmp/config:/root/.minio \
minio/minio server /data
sleep 5
- name: Juicefs Format
run: |
sudo ./juicefs format --trash-days 0 --storage minio --bucket http://127.0.0.1:9000/mypics \
--access-key minioadmin \
--secret-key minioadmin \
redis://127.0.0.1:6379/1 pics
- name: Juicefs Mount
run: |
sudo ./juicefs mount -d redis://127.0.0.1:6379/1 /data/jfs --no-usage-report &
- name: Install Dependency
run: |
cd ~
git clone https://github.com/spack/spack.git
source spack/share/spack/setup-env.sh
spack --version
spack bootstrap now
spack compiler find
spack compilers
spack config get config > ~/.spack/config.yaml
sed -i '/build_stage:/,+2d' ~/.spack/config.yaml
echo -e "build_stage:\n - /data/jfs/spack-stage" >> ~/.spack/config.yaml
cd -

- name: Run Workload
run: |
if [ ${{matrix.app}} == "kernel" ];then
cp .github/scripts/build_kernel.sh /data/jfs
cd /data/jfs && bash build_kernel.sh
else
spack install ${{matrix.app}}
fi
- name: Log
if: always()
run: |
df -lh
echo "juicefs log"
sudo tail -n 1000 /var/log/juicefs.log
grep "<FATAL>:" /var/log/juicefs.log && exit 1 || true

0 comments on commit 45577b9

Please sign in to comment.