Skip to content

Update main.yml

Update main.yml #773

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the $default-branch branch
push:
branches: [ dc-master ]
pull_request:
branches: [ dc-master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: self-hosted
env:
http_proxy: "http://10.10.3.72:7890"
https_proxy: "http://10.10.3.72:7890"
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Runs a set of commands using the runners shell
- name: build-linux
id: build-linux
run: |
sudo docker ps
pwd
sudo docker run --rm --name build-linux-$GITHUB_RUN_ID --privileged=true -v /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux:/home main-linux:v2 /bin/bash -c "cd /home && export ARCH=riscv && export INSTALL_MOD_PATH=/home && export CROSS_COMPILE=/usr/bin/riscv64-linux-gnu- && make defconfig && make -j$(nproc) && make modules_install"
sudo chown -R gitlab-runner:gitlab-runner /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux
sudo chmod -R 755 /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux
- name: send-mail
if: ${{ failure() && steps.build-linux.conclusion == 'failure' }}
# if: ${{ success() && steps.build-linux.conclusion == 'success' }}
env:
mail: ${{ secrets.SEND_MAIL }}
run: |
echo $mail
echo "CI build code failure ! $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/$JOB_ID" | mail -s "build code" $mail
- name: upload
env:
passd: ${{ secrets.SEND_MAIL }}
run: |
cd /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/lib
zip -r -y modules.zip modules
curl -uadmin:${{secrets.ADMIN_PASS}} -T modules.zip ${{secrets.JFROG_PATH}}/modules.zip
cd /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/arch/riscv
zip -r -y boot.zip boot
curl -uadmin:${{secrets.ADMIN_PASS}} -T boot.zip ${{secrets.JFROG_PATH}}/boot.zip