Skip to content

Commit

Permalink
🛤️ ✨ init containerized build
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Zhang <[email protected]>
  • Loading branch information
zwpaper committed Feb 15, 2024
1 parent 3fc50ef commit 039b4fa
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:

build:
name: Build
if: false
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -279,6 +280,51 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

container_build:
name: Container Build
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
matrix:
job:
- { os: ubuntu-latest, target: loongarch64-unknown-linux-gnu, platform: loong64 }
steps:
- uses: actions/checkout@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:master
- name: Containerized Build
shell: bash
run: |
docker run --platform linux/${{ matrix.job.platform }} \
-v `pwd`:/src \
kweizh/loongarch-rust:v0.1.0 \
build --release --target ${{ matrix.job.target }}
# determine EXE suffix
EXE_suffix="" ; case ${{ matrix.job.target }} in *-pc-windows-*) EXE_suffix=".exe" ;; esac;
echo set-output name=EXE_suffix::${EXE_suffix}
echo ::set-output name=EXE_suffix::${EXE_suffix}
- name: Test
if: matrix.job.target != 'aarch64-apple-darwin'
shell: bash
run: |
docker run --platform linux/${{ matrix.job.platform }} -v `pwd`:/src kweizh/loongarch-rust:v0.1.0 test --target ${{ matrix.job.target }}
- name: Archive executable artifacts
uses: actions/upload-artifact@master
with:
name: ${{ env.PROJECT_NAME }}-${{ matrix.job.target }}
path: target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

coverage:
name: Code Coverage
runs-on: ${{ matrix.job.os }}
Expand Down

0 comments on commit 039b4fa

Please sign in to comment.