Skip to content

Commit 075a4bb

Browse files
add k3-master github actions
1 parent adf5afa commit 075a4bb

1 file changed

Lines changed: 78 additions & 0 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the $default-branch branch
8+
push:
9+
branches: [ k3-master ]
10+
pull_request:
11+
branches: [ k3-master ]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
# This workflow contains a single job called "build"
19+
build:
20+
# The type of runner that the job will run on
21+
runs-on: self-hosted
22+
env:
23+
http_proxy: "http://10.10.3.72:7890"
24+
https_proxy: "http://10.10.3.72:7890"
25+
# Steps represent a sequence of tasks that will be executed as part of the job
26+
steps:
27+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28+
- name: Checkout k3-master
29+
uses: actions/checkout@v4
30+
with:
31+
ref: k3-master
32+
path: k3-linux
33+
# Runs a set of commands using the runners shell
34+
- name: build-linux
35+
id: build-linux
36+
run: |
37+
sudo docker ps
38+
pwd
39+
sudo docker run \
40+
--rm \
41+
--name build-linux-$GITHUB_RUN_ID \
42+
--privileged=true \
43+
-v /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/k3-linux:/k3 \
44+
harbor.spacemit.com/bianbu/k3-bsp-builder:latest \
45+
/bin/bash -c "
46+
cd /k3
47+
git config --global --add safe.directory /k3
48+
export TOOLCHAIN=/opt/spacemit-toolchain-linux-glibc-x86_64-v1.2.2
49+
export PATH=$TOOLCHAIN/bin:$PATH
50+
export ARCH=riscv
51+
export CROSS_COMPILE=riscv64-linux-gnu-
52+
apt update
53+
apt install -y gcc-riscv64-linux-gnu
54+
make defconfig
55+
make -j$(nproc) bindeb-pkg
56+
"
57+
- name: send-mail
58+
if: ${{ failure() && steps.build-linux.conclusion == 'failure' }}
59+
# if: ${{ success() && steps.build-linux.conclusion == 'success' }}
60+
env:
61+
mail: ${{ secrets.SEND_MAIL }}
62+
run: |
63+
echo $mail
64+
echo "CI build code failure ! $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/$JOB_ID" | mail -s "build code" $mail
65+
66+
- name: upload
67+
env:
68+
passd: ${{ secrets.SEND_MAIL }}
69+
run: |
70+
cd /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/
71+
sudo rm -rf k3-linux
72+
# zip -r -y modules.zip modules
73+
# curl -uadmin:${{secrets.ADMIN_PASS}} -T modules.zip ${{secrets.JFROG_PATH}}/modules.zip
74+
# cd /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/arch/riscv
75+
# zip -r -y boot.zip boot
76+
# curl -uadmin:${{secrets.ADMIN_PASS}} -T boot.zip ${{secrets.JFROG_PATH}}/boot.zip
77+
78+

0 commit comments

Comments
 (0)