Skip to content

Commit

Permalink
Update tempbuild.yml
Browse files Browse the repository at this point in the history
test to cleanup host before running build in container
  • Loading branch information
marc1uk authored Feb 7, 2024
1 parent 79f6e86 commit b0566c2
Showing 1 changed file with 89 additions and 17 deletions.
106 changes: 89 additions & 17 deletions .github/workflows/tempbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,93 @@ jobs:

build_1:
runs-on: ubuntu-latest
container: 'anniesoft/toolanalysis:latest'
#container: 'anniesoft/toolanalysis:latest'
steps:
- uses: actions/checkout@v2
- name: prerequisits
run: yum install -y git make gcc-c++ which wget
- name: build
run:
# Workaround to provide additional free space for testing.
# https://github.com/actions/virtual-environments/issues/2840
df -h;
rm -rf /usr/share/dotnet;
rm -rf /opt/ghc;
rm -rf "/usr/local/share/boost";
rm -rf "$AGENT_TOOLSDIRECTORY";
df -h;
echo `pwd` && ln -s /ToolAnalysis/ToolDAQ $PWD/ToolDAQ && ls -l && ls -l ./ToolDAQ && source ./Setup.sh && make clean && make
- name: test
run : source ./Setup.sh && ./Analyse
- name: Check disk space
run: |
sudo dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -nr | head
df . -h
sudo du / -hx -d 4 --threshold=1G | sort -hr | head
- name: Free disk space
run: |
# https://github.com/actions/virtual-environments/issues/2840
# https://stackoverflow.com/questions/75536771/github-runner-out-of-disk-space-after-building-docker-image
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
/usr/lib/jvm /usr/local/share/boost || true
sudo rm -rf "$AGENT_TOOLSDIRECTORY";
echo "some directories deleted"
sudo apt install aptitude -y >/dev/null 2>&1
sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \
esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \
google-cloud-sdk google-cloud-cli imagemagick \
libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \
mercurial apt-transport-https mono-complete libmysqlclient \
unixodbc-dev yarn chrpath libssl-dev libxft-dev \
libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \
snmp pollinate libpq-dev postgresql-client powershell ruby-full \
sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \
-y -f >/dev/null 2>&1
sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1
sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
sudo aptitude purge google-chrome-stable -f -y >/dev/null 2>&1 || true
sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1
sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1
sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1
sudo aptitude purge '~n ^temurin' -f -y >/dev/null 2>&1
sudo apt-get autoremove -y >/dev/null 2>&1
sudo apt-get autoclean -y >/dev/null 2>&1
echo "some packages purged"
docker rmi $(docker image ls -aq) || true
sudo swapoff /swapfile || true
sudo rm -rf /swapfile
sudo apt-get autoremove -y >/dev/null 2>&1 || true
sudo apt-get autoclean -y >/dev/null 2>&1 || true
- name: Check disk space
run: |
sudo dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -nr | head
df . -h
sudo du / -hx -d 4 --threshold=1G | sort -hr | head
- uses: actions/checkout@v2

##################

#- name: prerequisites
# run: yum install -y git make gcc-c++ which wget

#- name: build
# run:
# echo `pwd` && ln -s /ToolAnalysis/ToolDAQ $PWD/ToolDAQ && ls -l && ls -l ./ToolDAQ && source ./Setup.sh && make clean && make

##################

#- name: test
# run : source ./Setup.sh && ./Analyse

#- name: build and test
# uses: docker://anniesoft/toolanalysis:latest
# with:
# entrypoint: /bin/bash
# args: -c "echo `pwd` && ln -s /ToolAnalysis/ToolDAQ $PWD/ToolDAQ && ls -l && ls -l ./ToolDAQ && source ./Setup.sh && make clean && make && ./Analyse"

- name: build and test
- uses: addnab/docker-run-action@v3
with:
image: anniesoft/toolanalysis:latest
options: -v ${{ github.workspace }}:/ToolAnalysis
run: |
echo "Running Script"
echo `pwd`
ln -s /ToolAnalysis/ToolDAQ $PWD/ToolDAQ
ls -l
ls -l ./ToolDAQ
source ./Setup.sh
make clean
make
./Analyse

0 comments on commit b0566c2

Please sign in to comment.