Skip to content

Building images πŸš€ #2

Building images πŸš€

Building images πŸš€ #2

name: Build testing
run-name: "Building images πŸš€"
on: [push, pull_request]
jobs:
build-job:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cfg:
- { model: "gt-ax6000", sdk: "src-rt-5.04axhnd.675x", skip: false }
- { model: "gt-ax11000_pro", sdk: "src-rt-5.04axhnd.675x", skip: false }
- { model: "gt-axe16000", sdk: "src-rt-5.04axhnd.675x", skip: false }
- { model: "rt-ax86u_pro", sdk: "src-rt-5.04axhnd.675x", skip: false }
- { model: "rt-ax88u_pro", sdk: "src-rt-5.04axhnd.675x", skip: false }
- { model: "xt12", sdk: "src-rt-5.04axhnd.675x", skip: false }
container:
image: paldier/swrt-docker:latest
env:
MODELCFG: ${{ matrix.cfg.model }}
SDK: ${{ matrix.cfg.sdk }}
SKIP_BUILD: ${{ matrix.cfg.skip }}
GIT_REPO: "https://github.com/SWRT-dev/asuswrt-bcm.git"
PROJECT_DIR: "/project/asuswrt-bcm"
PROJECTBASEDIR: "/project" # REMOVE_ME: Fixes https://github.com/SonarSource/sonarcloud-github-action/pull/58
options: --user docker
volumes:
- /mnt:/project # HACK: Use /mnt partition since bigger than others. This prevents to run out of space
steps:
- name: Run debug commands - post
run: |
cd /
echo "--- Disk available ----"
df -h
- name: Fix permissions in docker image
if: matrix.cfg.skip == false
run: |
sudo chown -R docker:docker /github/home /home/docker /project
- name: "Fetch code"
if: matrix.cfg.skip == false
run: |
cd /project
if [[ $SKIP_BUILD == "true" ]]; then
echo "Skipping build!"
exit 0
fi
if [[ $GITHUB_REF_TYPE == "tag" ]]; then
export TAG="${GITHUB_REF#refs/tags/}"
echo "Fetching code from tag $TAG"
else
export BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
echo "Fetching code from branch $BRANCH"
fi
if git clone --depth 1 --branch "${TAG:-$BRANCH}" "$GIT_REPO"; then
echo "Code fetched successfully."
else
echo "Failed to fetch code. Check the repository and settings."
exit 1
fi
ls /home/docker
- name: "Build"
if: matrix.cfg.skip == false
run: |
if [[ $SKIP_BUILD == "true" ]]; then
echo "Skipping build!"
exit 0
fi
echo "----- Space available -----"
df -h
echo "----- I am: $(id) -----"
cd ${PROJECT_DIR}/release/${SDK}
echo "----- Files in dir: $(pwd) -----"
ls -alh
echo "----- Setting toolchains for ${SDK} -----"
sudo /home/docker/envs/bcm.sh
echo "----- Check envs dir ---------"
ls -alh /home/docker/envs/
echo "----- Debugging env vars -----"
env
echo "----- BUILD ${MODELCFG}-----"
make "${MODELCFG}"