Skip to content

Commit

Permalink
feat: add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lichuang committed Oct 1, 2024
1 parent a2bee4c commit 38e5f64
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Setup Rust Builder
description: 'Prepare Rust Build Environment'

runs:
using: "composite"
steps:
- name: Setup rust related environment variables
shell: bash
run: |
# Disable full debug symbol generation to speed up CI build and keep memory down
# "1" means line tables only, which is useful for panic tracebacks.
# About `force-frame-pointers`, here's the discussion history: https://github.com/apache/opendal/issues/3756
echo "RUSTFLAGS=-C force-frame-pointers=yes -C debuginfo=1" >> $GITHUB_ENV
# Enable backtraces
echo "RUST_BACKTRACE=1" >> $GITHUB_ENV
# Enable logging
echo "RUST_LOG=opendal=trace" >> $GITHUB_ENV
# Enable sparse index
echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" >> $GITHUB_ENV
# Make sure rust has been setup
cargo version
24 changes: 24 additions & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Unit Test

on:
schedule: # execute every 24 hours
- cron: "* */24 * * *"
workflow_dispatch:

jobs:
plan:
runs-on: ubuntu-latest
steps:
- name: 'Checkout codes'
uses: actions/checkout@v4
with:
# fetch depth set to 0 to make sure we have correct diff result.
fetch-depth: 0

- name: Setup Rust toolchain
uses: ./.github/actions/setup

- name: 'Run Unit tests'
shell: bash
run: |
cargo test

0 comments on commit 38e5f64

Please sign in to comment.