Skip to content

Use conda-lock for dependencies #179

Use conda-lock for dependencies

Use conda-lock for dependencies #179

Workflow file for this run

name: run-tests
on:
# run ci when the following branches are pushed to (i.e. after merge)
push:
branches:
- master
# run ci when pring to following branches (note: ci runs on the merge commit of the pr!)
pull_request:
branches:
- master
defaults:
run:
shell: bash -leo pipefail {0}
env:
REMOTE_WORK_DIR: /scratch/buildbot/firemarshal-ci-shared/firemarshal-${{ github.sha }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.BARTENDER_PERSONAL_ACCESS_TOKEN }}
jobs:
cancel-prior-workflows:
name: cancel-prior-workflows
runs-on: ubuntu-20.04
steps:
- name: Cancel previous workflow runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
# Set up a set of boolean conditions to control which branches of the CI
# workflow will execute This is based off the conditional job execution
# example here: https://github.com/dorny/paths-filter#examples
change-filters:
name: filter-jobs-on-changes
runs-on: ubuntu-20.04
# Queried by downstream jobs to determine if they should run.
outputs:
run-core: ${{ steps.filter.outputs.all_count != steps.filter.outputs.non-core-files_count }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
all:
- '**'
# Check for if docs files changed
docs: &docs-filter
- 'docs/**'
- '.readthedocs.yml'
# Check for non-FireMarshal core file changes
non-core-files:
- *docs-filter
- '**/*.md'
- '**/.gitignore'
setup-repo:
name: setup-repo
needs: change-filters
if: needs.change-filters.outputs.run-core == 'true'
runs-on: firemarshal
steps:
- name: Delete old checkout
run: |
ls -alh .
rm -rf ${{ env.REMOTE_WORK_DIR }}/* || true
rm -rf ${{ env.REMOTE_WORK_DIR }}/.* || true
rm -rf ${{ github.workspace }}/* || true
rm -rf ${{ github.workspace }}/.* || true
- uses: actions/checkout@v4
- name: Setup repo copy
run: |
git clone $GITHUB_WORKSPACE ${{ env.REMOTE_WORK_DIR }}
- name: Setup conda (install all deps)
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
./scripts/setup-conda.sh
- name: Install Spike
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
conda activate $PWD/.conda-env
git clone https://github.com/riscv-software-src/riscv-isa-sim.git
cd riscv-isa-sim
git checkout 4d8651b
mkdir build
cd build
../configure --prefix=$RISCV --with-boost=no --with-boost-asio=no --with-boost-regex=no
make -j16
make install
- name: Initialize all submodules
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
conda activate $PWD/.conda-env
./init-submodules.sh
- name: Verify open file limits
run: |
HARD_LIMIT=$(ulimit -Hn)
REQUIRED_LIMIT=16384
if [ "$HARD_LIMIT" -lt "$REQUIRED_LIMIT" ]; then
echo "ERROR: Your system does not support an open files limit (the output of 'ulimit -Sn' and 'ulimit -Hn') of at least $REQUIRED_LIMIT, which is required to workaround a bug in buildroot. You will not be able to build a Linux distro with FireMarshal until this is addressed."
exit 1
fi
ulimit -Sn $(ulimit -Hn)
build-upload-br-image:
name: build-upload-br-image
needs: [setup-repo]
if: ${{ github.ref == 'master' }}
runs-on: firemarshal
steps:
- name: Build buildroot image
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
conda activate $PWD/.conda-env
./marshal -v build br-base.json
./scripts/upload-br-image.py
run-tests:
name: run-tests
needs: [setup-repo]
runs-on: firemarshal
steps:
- name: Run tests (- spike tests)
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
conda activate $PWD/.conda-env
./scripts/fullTest.py -c baremetal qemu smoke special -s
- name: Dump log
if: ${{ always() }}
run: |
cd ${{ env.REMOTE_WORK_DIR }}
cat ./scripts/testLogs/*.log
cleanup:
name: cleanup
needs: [setup-repo, build-upload-br-image, run-tests]
runs-on: firemarshal
if: ${{ always() }}
steps:
- name: Delete repo copy and conda env
run: |
rm -rf ${{ env.REMOTE_WORK_DIR }}