From 902731f3deb9e50429b245142cdf0df302ba8873 Mon Sep 17 00:00:00 2001 From: Andelf Date: Wed, 1 May 2024 06:53:28 +0800 Subject: [PATCH] ci: add CI build --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++++++ ci.sh | 8 ++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100755 ci.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9bc1552 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: CI build + +on: + push: + branches: ["main"] + paths-ignore: + - "*.md" + pull_request: + branches: ["main"] + paths-ignore: + - "*.md" + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use nightly Rust + run: | + rustup default nightly + rustup target add riscv32imac-unknown-none-elf + rustup target add riscv32imafc-unknown-none-elf + rustup target add riscv32i-unknown-none-elf + - name: Fetch Deps + run: | + mkdir -p ../ch32-data/build/ + cd ../ch32-data/build/ + git clone https://github.com/ch32-rs/ch32-metapac.git + - name: Build Only + run: | + ./ci.sh diff --git a/ci.sh b/ci.sh new file mode 100755 index 0000000..a074922 --- /dev/null +++ b/ci.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -ex +set -o pipefail + +for d in $(find examples -type d -depth 1); do + (cd $d && cargo build --release) +done