image: "librerouter/librerouteros-builder:latest" variables: DOWNLOAD_CACHE: "/home/build/cache/dl" # use volumes = ["/cache:/home/build/cache:rw"] in the /etc/gitlab-runner/config.toml ADDITIONAL_FILES_PATH: "/home/build/files" .build_script: &build_script | echo CONFIG_DOWNLOAD_FOLDER=\"${DOWNLOAD_CACHE}\" >> .config echo CONFIG_BUILD_LOG=y >> .config make defconfig make download > /dev/null make -j$(nproc) stages: - build - test full_build: stage: build artifacts: name: "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" paths: - bin/ - logs/ when: always expire_in: 1 week script: # this copies additional files - cp -r ${ADDITIONAL_FILES_PATH}/. . - ./scripts/feeds update -a - ./scripts/feeds install -a - mkdir -p ${DOWNLOAD_CACHE} # default build (LibreRouter only) - cp configs/default_config .config - *build_script # Build other ath79 boards # remove explicit LibreRouter device - cp configs/default_config .config - sed -i '/CONFIG_TARGET_ath79_generic_DEVICE_librerouter_librerouter-v1/d' .config # add multi devices configs - cat configs/default_config_multi >> .config # remove cmdline bootargs support from the kernel config as tplink bootoloader has bad args - patch -p1 < configs/revert-cmdline-config.patch - make defconfig - make target/linux/clean - *build_script # build x86_64 - cp configs/default_config_x86_64 .config - *build_script # cleaning up - rm -f bin/targets/ath79/generic/*vmlinux* - rm -f bin/targets/ath79/generic/*kernel.bin - rm -f bin/targets/ath79/generic/*generic-root.squashfs - rm -f bin/targets/x86/64/*vmlinux* - rm -rf logs # remove the logs if the build was successful system_tests: stage: test image: "librerouter/fwsystests:1.0" script: - wget -q https://gitlab.com/librerouter/fwsystests/-/archive/master/fwsystests-master.tar.gz - tar xf fwsystests-master.tar.gz - cd fwsystests-master - FW_ROOTFS=$(readlink -f ../bin/targets/x86/64/*rootfs.tar.gz) - FW_RAMFS=$(readlink -f ../bin/targets/x86/64/*.bzImage) - QEMU_ARGS="$FW_ROOTFS $FW_RAMFS" PYTHONPATH=. pytest --verbose needs: - job: full_build artifacts: true