-
Notifications
You must be signed in to change notification settings - Fork 15
81 lines (77 loc) · 2.81 KB
/
github-actions.yml
File metadata and controls
81 lines (77 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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: "rt-ax89u", sdk: "src-qca-ipq806x", 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/rtax89x.git"
PROJECT_DIR: "/project/rtax89x"
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 ln -sf /home/docker/qca-toolchains/openwrt-gcc463.arm /opt/
echo "----- Check envs dir ---------"
ls -alh /home/docker/envs/
echo "----- Debugging env vars -----"
env
echo "----- BUILD ${MODELCFG}-----"
make "${MODELCFG}"