|
| 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: [ dc-master ] |
| 10 | + pull_request: |
| 11 | + branches: [ dc-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 | + - uses: actions/checkout@v4 |
| 29 | + # Runs a set of commands using the runners shell |
| 30 | + - name: build-linux |
| 31 | + id: build-linux |
| 32 | + run: | |
| 33 | + sudo docker ps |
| 34 | + pwd |
| 35 | + 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" |
| 36 | + sudo chown -R gitlab-runner:gitlab-runner /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux |
| 37 | + sudo chmod -R 755 /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux |
| 38 | + - name: send-mail |
| 39 | + if: ${{ failure() && steps.build-linux.conclusion == 'failure' }} |
| 40 | + # if: ${{ success() && steps.build-linux.conclusion == 'success' }} |
| 41 | + env: |
| 42 | + mail: ${{ secrets.SEND_MAIL }} |
| 43 | + run: | |
| 44 | + echo $mail |
| 45 | + echo "CI build code failure ! $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/$JOB_ID" | mail -s "build code" $mail |
| 46 | + |
| 47 | + - name: upload |
| 48 | + env: |
| 49 | + passd: ${{ secrets.SEND_MAIL }} |
| 50 | + run: | |
| 51 | + cd /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/lib |
| 52 | + zip -r -y modules.zip modules |
| 53 | + curl -uadmin:${{secrets.ADMIN_PASS}} -T modules.zip ${{secrets.JFROG_PATH}}/modules.zip |
| 54 | + cd /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/arch/riscv |
| 55 | + zip -r -y boot.zip boot |
| 56 | + curl -uadmin:${{secrets.ADMIN_PASS}} -T boot.zip ${{secrets.JFROG_PATH}}/boot.zip |
| 57 | +
|
| 58 | +
|
0 commit comments