Skip to content

Commit

Permalink
Update build-openwrt.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Gzxhwq committed Nov 2, 2024
1 parent f9298d2 commit 5cc3c96
Showing 1 changed file with 76 additions and 76 deletions.
152 changes: 76 additions & 76 deletions .github/workflows/build-openwrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,68 +40,68 @@ jobs:
contents: write

steps:
# - name: Before freeing up disk space
# run: |
# echo "Before freeing up disk space"
# echo "=============================================================================="
# df -hT
# echo "=============================================================================="

# - name: "Optimize Disk Space"
# uses: "hugoalh/disk-space-optimizer-ghaction@v0.8.1"
# with:
# operate_sudo: "True"
# general_include: ".+"
# general_exclude: |-
# ^GCC$
# ^G\+\+$
# Clang
# LLVM
# docker_include: ".+"
# docker_prune: "True"
# docker_clean: "True"
# apt_prune: "True"
# apt_clean: "True"
# homebrew_prune: "True"
# homebrew_clean: "True"
# npm_prune: "True"
# npm_clean: "True"
# os_swap: "True"

# - name: Freeing up disk space
# uses: easimon/maximize-build-space@master
# with:
# root-reserve-mb: 2048
# swap-size-mb: 1
# remove-dotnet: 'true'
# remove-android: 'true'
# remove-haskell: 'true'
# remove-codeql: 'true'
# remove-docker-images: 'true'

# - name: Free up disk space complete
# run: |
# echo "Free up disk space complete"
# echo "=============================================================================="
# df -hT
# echo "=============================================================================="
- name: Before freeing up disk space
run: |
echo "Before freeing up disk space"
echo "=============================================================================="
df -hT
echo "=============================================================================="
- name: "Optimize Disk Space"
uses: "hugoalh/disk-space-optimizer-ghaction@v0.8.1"
with:
operate_sudo: "True"
general_include: ".+"
general_exclude: |-
^GCC$
^G\+\+$
Clang
LLVM
docker_include: ".+"
docker_prune: "True"
docker_clean: "True"
apt_prune: "True"
apt_clean: "True"
homebrew_prune: "True"
homebrew_clean: "True"
npm_prune: "True"
npm_clean: "True"
os_swap: "True"

- name: Freeing up disk space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 2048
swap-size-mb: 1
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'

- name: Free up disk space complete
run: |
echo "Free up disk space complete"
echo "=============================================================================="
df -hT
echo "=============================================================================="
- name: Checkout
uses: actions/checkout@v4

- name: Free Disk Space Before Build
run: |
echo "Disk space before cleanup:"
df -h
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /usr/local/lib/android/sdk/ndk
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo apt-get clean
echo "Disk space after cleanup:"
df -h
# - name: Free Disk Space Before Build
# run: |
# echo "Disk space before cleanup:"
# df -h
# sudo rm -rf /usr/local/.ghcup
# sudo rm -rf /opt/hostedtoolcache/CodeQL
# sudo rm -rf /usr/local/lib/android/sdk/ndk
# sudo rm -rf /usr/share/dotnet
# sudo rm -rf /opt/ghc
# sudo rm -rf /usr/local/share/boost
# sudo apt-get clean
# echo "Disk space after cleanup:"
# df -h

- name: Initialization environment
env:
Expand All @@ -114,15 +114,15 @@ jobs:
sudo rm -rf /etc/apt/sources.list.d/* /usr/local/lib/android /opt/ghc /usr/share/dotnet /usr/local/graalvm /usr/local/.ghcup \
/usr/local/share/powershell /usr/local/share/chromium /usr/local/lib/node_modules
sudo timedatectl set-timezone "$TZ"
sudo mkdir -p /workdir
sudo chown $USER:$GROUPS /workdir
# sudo mkdir -p /workdir
sudo chown $USER:$GROUPS $GITHUB_WORKSPACE
- name: Clone source code
working-directory: /workdir
working-directory: ./
run: |
df -hT $PWD
git clone $REPO_URL -b $REPO_BRANCH openwrt
ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
git clone --depth=1 $REPO_URL -b $REPO_BRANCH openwrt
# ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
cd openwrt
useVersionInfo=$(git show -s --date=short --format="Author: %an<br/>date: %cd<br/>commit: %s<br/>commit hash: %H")
echo "useVersionInfo=$useVersionInfo" >> $GITHUB_ENV
Expand Down Expand Up @@ -239,16 +239,16 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Free Disk Space After Build
run: |
echo "Disk space before post-build cleanup:"
df -h
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /usr/local/lib/android/sdk/ndk
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo apt-get clean
echo "Disk space after post-build cleanup:"
df -h
# - name: Free Disk Space After Build
# run: |
# echo "Disk space before post-build cleanup:"
# df -h
# sudo rm -rf /usr/local/.ghcup
# sudo rm -rf /opt/hostedtoolcache/CodeQL
# sudo rm -rf /usr/local/lib/android/sdk/ndk
# sudo rm -rf /usr/share/dotnet
# sudo rm -rf /opt/ghc
# sudo rm -rf /usr/local/share/boost
# sudo apt-get clean
# echo "Disk space after post-build cleanup:"
# df -h

0 comments on commit 5cc3c96

Please sign in to comment.