| 1 |
name: CI |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: ["main"] |
| 5 |
pull_request: |
| 6 |
merge_group: |
| 7 |
types: [checks_requested] |
| 8 |
|
| 9 |
|
| 10 |
workflow_dispatch: |
| 11 |
|
| 12 |
env: |
| 13 |
RUST_BACKTRACE: 1 |
| 14 |
SHELL: /bin/bash |
| 15 |
|
| 16 |
jobs: |
| 17 |
ci: |
| 18 |
name: Build and Test |
| 19 |
runs-on: ubuntu-latest |
| 20 |
|
| 21 |
strategy: |
| 22 |
matrix: |
| 23 |
rust: [1.70.0, nightly, beta, stable] |
| 24 |
|
| 25 |
steps: |
| 26 |
- uses: actions/checkout@v2 |
| 27 |
with: |
| 28 |
fetch-depth: 2 |
| 29 |
- name: Setup Rust |
| 30 |
uses: actions-rs/toolchain@v1 |
| 31 |
with: |
| 32 |
toolchain: ${{ matrix.rust }} |
| 33 |
default: true |
| 34 |
override: true |
| 35 |
- name: Build |
| 36 |
run: | |
| 37 |
cargo build --no-default-features |
| 38 |
cargo build |
| 39 |
cargo build --features malloc_size_of |
| 40 |
- uses: actions-rs/cargo@v1 |
| 41 |
with: |
| 42 |
command: test |
| 43 |
args: --all |
| 44 |
- name: Build codegen |
| 45 |
run: | |
| 46 |
cd string-cache-codegen && cargo build && cd .. |
| 47 |
|
| 48 |
if [ ${{ matrix.rust }} = nightly ]; then |
| 49 |
cd integration-tests && cargo test --features unstable && cd ..; |
| 50 |
fi |
| 51 |
|
| 52 |
|
| 53 |
build_result: |
| 54 |
name: Result |
| 55 |
runs-on: ubuntu-latest |
| 56 |
needs: |
| 57 |
- "ci" |
| 58 |
|
| 59 |
steps: |
| 60 |
- name: Mark the job as successful |
| 61 |
run: exit 0 |
| 62 |
if: success() |
| 63 |
- name: Mark the job as unsuccessful |
| 64 |
run: exit 1 |
| 65 |
if: "!success()" |