Add testing framework #86
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build debian stable | |
on: | |
pull_request: | |
# branches: | |
# - main | |
workflow_dispatch: | |
workflow_call: | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: debian:stable-slim | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: | | |
apt update | |
apt install -y g++-12 make lsb-release unzip libboost-all-dev libeigen3-dev libtiff-dev catch2 | |
- name: Check Packages Versions | |
if: false | |
run: | | |
dpkg-query -W -f='${binary:Package} ${Version}\n' g++-12 libboost-all-dev libeigen3-dev libtiff-dev catch2 > new_pkgs_debian.txt | |
if [ -n "$(diff new_pkgs_debian.txt pkgs_debian.txt)" ]; then | |
echo "::warning:: apt packages versions diff! $(diff new_pkgs_debian.txt pkgs_debian.txt)" | |
diff_output=$(diff --side-by-side --suppress-common-lines new_pkgs_debian.txt pkgs_debian.txt || true) | |
echo "$diff_output" | while IFS= read -r line; do | |
echo "$line" | |
done | |
fi | |
- name: Get Environment | |
id: get_env | |
run: | | |
DISTRIBUTION=$( lsb_release --short --id 2>/dev/null ) | |
CODENAME=$( lsb_release --short --codename 2>/dev/null ) | |
MACHINE=$( uname --machine 2>/dev/null ) | |
echo "SUFFIX=".${DISTRIBUTION}.${CODENAME}.${MACHINE}"" >> $GITHUB_ENV | |
- name: Build | |
run: | | |
cd Cell2Fire | |
make clean | |
make | |
ldd Cell2Fire > ldd${{ env.SUFFIX }}.txt | |
mv Cell2Fire Cell2Fire${{ env.SUFFIX }} | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: binaries${{ env.SUFFIX }} | |
path: | | |
Cell2Fire/ldd${{ env.SUFFIX }}.txt | |
Cell2Fire/Cell2Fire${{ env.SUFFIX }} | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
container: debian:stable-slim | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: | | |
apt update | |
apt install -y g++-12 make lsb-release unzip libtiff6 libgomp1 libeigen3-dev catch2 | |
# apt install -y g++-12 make lsb-release unzip libboost-all-dev libeigen3-dev libtiff-dev catch2 | |
- name: Get Environment | |
id: get_env | |
run: | | |
DISTRIBUTION=$( lsb_release --short --id 2>/dev/null ) | |
CODENAME=$( lsb_release --short --codename 2>/dev/null ) | |
MACHINE=$( uname --machine 2>/dev/null ) | |
echo "SUFFIX=".${DISTRIBUTION}.${CODENAME}.${MACHINE}"" >> $GITHUB_ENV | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: binaries${{ env.SUFFIX }} | |
path: Cell2Fire | |
merge-multiple: true | |
- name: chmod | |
run: | | |
ls Cell2Fire | |
chmod +x Cell2Fire/Cell2Fire* | |
- name: Unit Test | |
run: | | |
cd Cell2Fire | |
make tests | |
- name: Bash Test | |
run: | | |
cd test | |
bash test.sh ${{ env.SUFFIX }} |