mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-26 20:10:24 +00:00
First GitHub Actions test
This commit is contained in:
parent
71188c3202
commit
2862779617
5
.github/bors.toml
vendored
5
.github/bors.toml
vendored
@ -1,4 +1,3 @@
|
||||
block_labels = ["S-blocked"]
|
||||
delete_merged_branches = true
|
||||
status = [
|
||||
"continuous-integration/travis-ci/push",
|
||||
]
|
||||
status = ["ci"]
|
||||
|
325
.github/workflows/build.yml
vendored
Normal file
325
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,325 @@
|
||||
name: Build
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- staging
|
||||
- trying
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
# Run cargo fmt --check
|
||||
style:
|
||||
name: style
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- name: cargo fmt --check
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
|
||||
# Compilation check
|
||||
check:
|
||||
name: check
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
- riscv32imc-unknown-none-elf
|
||||
- x86_64-unknown-linux-gnu
|
||||
- armv7r-none-eabi
|
||||
- thumbv6m-none-eabi
|
||||
- thumbv7m-none-eabi
|
||||
- thumbv8m.base-none-eabi
|
||||
- thumbv8m.main-none-eabi
|
||||
toolchain:
|
||||
- stable
|
||||
- nightly
|
||||
features:
|
||||
- ""
|
||||
- "serde"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache cargo dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
- ~/.cargo/bin/
|
||||
- ~/.cargo/registry/index/
|
||||
- ~/.cargo/registry/cache/
|
||||
- ~/.cargo/git/db/
|
||||
key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
${{ runner.OS }}-cargo-
|
||||
|
||||
- name: Cache build output dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: target
|
||||
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
|
||||
${{ runner.OS }}-build-
|
||||
|
||||
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }})
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.toolchain }}
|
||||
target: ${{ matrix.target }}
|
||||
override: true
|
||||
|
||||
- name: cargo check
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
use-cross: false
|
||||
command: check
|
||||
args: --target=${{ matrix.target }} --features=${{ matrix.features }}
|
||||
|
||||
# Run cpass tests
|
||||
testcpass:
|
||||
name: testcpass
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
toolchain:
|
||||
- stable
|
||||
- nightly
|
||||
- 1.36.0
|
||||
features:
|
||||
- serde
|
||||
buildtype:
|
||||
- ""
|
||||
- "--release"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache cargo dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
- ~/.cargo/bin/
|
||||
- ~/.cargo/registry/index/
|
||||
- ~/.cargo/registry/cache/
|
||||
- ~/.cargo/git/db/
|
||||
key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
${{ runner.OS }}-cargo-
|
||||
|
||||
- name: Cache build output dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: target
|
||||
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
|
||||
${{ runner.OS }}-build-
|
||||
|
||||
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }})
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.toolchain }}
|
||||
target: ${{ matrix.target }}
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
use-cross: false
|
||||
command: test
|
||||
args: --test cpass --target=${{ matrix.target }} --features=${{ matrix.features }} ${{ matrix.buildtype }}
|
||||
|
||||
# Run test suite for UI
|
||||
testtsan:
|
||||
name: testtsan
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
toolchain:
|
||||
- nightly
|
||||
features:
|
||||
- x86-sync-pool
|
||||
buildtype:
|
||||
- ""
|
||||
- "--release"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache cargo dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
- ~/.cargo/bin/
|
||||
- ~/.cargo/registry/index/
|
||||
- ~/.cargo/registry/cache/
|
||||
- ~/.cargo/git/db/
|
||||
key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-cargo-
|
||||
|
||||
- name: Cache build output dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: target
|
||||
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-
|
||||
|
||||
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }})
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.toolchain }}
|
||||
target: ${{ matrix.target }}
|
||||
override: true
|
||||
|
||||
- name: Export variables
|
||||
run: |
|
||||
echo RUSTFLAGS="-Z sanitizer=thread" >> $GITHUB_ENV
|
||||
echo TSAN_OPTIONS="suppressions=$(pwd)/suppressions.txt" >> $GITHUB_ENV
|
||||
echo $GITHUB_ENV
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
use-cross: false
|
||||
command: test
|
||||
args: --test tsan --target=${{ matrix.target }} --features=${{ matrix.features }} ${{ matrix.buildtype }}
|
||||
|
||||
# Run cfail tests on MSRV
|
||||
testcfail:
|
||||
name: testcfail
|
||||
runs-on: ubuntu-20.04
|
||||
defaults:
|
||||
run:
|
||||
working-directory: cfail
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache cargo dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
- ~/.cargo/bin/
|
||||
- ~/.cargo/registry/index/
|
||||
- ~/.cargo/registry/cache/
|
||||
- ~/.cargo/git/db/
|
||||
key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-cargo-
|
||||
|
||||
- name: Cache build output dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: target
|
||||
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: 1.36.0
|
||||
target: x86_64-unknown-linux-gnu
|
||||
override: true
|
||||
|
||||
- name: Run cargo
|
||||
run: cargo run
|
||||
|
||||
# Only runs when pushing to master branch
|
||||
deploy:
|
||||
name: deploy
|
||||
runs-on: ubuntu-20.04
|
||||
needs:
|
||||
- style
|
||||
- check
|
||||
- testcpass
|
||||
- testtsan
|
||||
- testcfail
|
||||
# Only run this when pushing to master branch
|
||||
if: github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
# Semantic version range syntax or exact version of a Python version
|
||||
python-version: '3.x'
|
||||
# Optional - x64 or x86 architecture, defaults to x64
|
||||
architecture: 'x64'
|
||||
|
||||
# You can test your matrix by printing the current Python version
|
||||
- name: Display Python version
|
||||
run: python -c "import sys; print(sys.version)"
|
||||
|
||||
- name: mdBook Action
|
||||
uses: peaceiris/actions-mdbook@v1.1.13
|
||||
with:
|
||||
mdbook-version: 'latest'
|
||||
|
||||
- name: Remove cargo-config
|
||||
run: rm -f .cargo/config
|
||||
|
||||
- name: Build docs
|
||||
run: cargo doc
|
||||
|
||||
- name: Deploy to GH-pages
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./target/doc
|
||||
|
||||
# Refs: https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149
|
||||
#
|
||||
# ALL THE PREVIOUS JOBS NEEDS TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
|
||||
|
||||
ci-success:
|
||||
name: ci
|
||||
if: github.event_name == 'push' && success()
|
||||
needs:
|
||||
- style
|
||||
- check
|
||||
- testcpass
|
||||
- testtsan
|
||||
- testcfail
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Mark the job as a success
|
||||
run: exit 0
|
||||
ci-failure:
|
||||
name: ci
|
||||
if: github.event_name == 'push' && !success()
|
||||
needs:
|
||||
- style
|
||||
- check
|
||||
- testcpass
|
||||
- testtsan
|
||||
- testcfail
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Mark the job as a failure
|
||||
run: exit 1
|
6
.github/workflows/properties/build.properties.json
vendored
Normal file
6
.github/workflows/properties/build.properties.json
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "Build",
|
||||
"description": "Heapless Test Suite",
|
||||
"iconName": "rust",
|
||||
"categories": ["Rust"]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user