2020-07-25 10:02:06 +02:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-01-27 09:57:47 +01:00
|
|
|
- main
|
2021-08-21 04:09:32 +02:00
|
|
|
- master
|
2020-07-25 10:02:06 +02:00
|
|
|
pull_request: {}
|
|
|
|
|
2022-07-13 13:12:53 +02:00
|
|
|
env:
|
2022-08-29 08:44:56 +02:00
|
|
|
RUST_MSRV: 1.61.0
|
2022-07-13 13:12:53 +02:00
|
|
|
|
2020-07-25 10:02:06 +02:00
|
|
|
jobs:
|
2022-07-13 13:12:53 +02:00
|
|
|
msrv:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-01-31 18:37:37 +01:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/cache@v4
|
2022-07-13 13:12:53 +02:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin
|
|
|
|
~/.cargo/registry/index
|
|
|
|
~/.cargo/registry/cache
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target
|
|
|
|
key: "${{ runner.os }}-cargo-build-msrv-${{ hashFiles('**/Cargo.lock') }}"
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: ${{ env.RUST_MSRV }}
|
|
|
|
override: true
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: check
|
2022-10-12 08:49:05 +02:00
|
|
|
|
2020-07-25 10:02:06 +02:00
|
|
|
# typical build with various feature combinations
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
continue-on-error: ${{ matrix.experimental }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
flags:
|
|
|
|
- ""
|
2023-03-02 06:16:15 +01:00
|
|
|
- "--features testing-environ,debugging"
|
|
|
|
- "--features testing-environ,metadata,serde,internals"
|
|
|
|
- "--features testing-environ,unchecked,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,sync,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,no_position,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,no_optimize,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,no_float,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,f32_float,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,decimal,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,no_custom_syntax,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,no_float,decimal"
|
|
|
|
- "--tests --features testing-environ,only_i32,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,only_i64,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,no_index,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,no_object,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,no_function,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,no_module,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,no_time,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,no_closure,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,unicode-xid-ident,serde,metadata,internals,debugging"
|
|
|
|
- "--features testing-environ,sync,no_time,no_function,no_float,no_position,no_optimize,no_module,no_closure,no_custom_syntax,metadata,serde,unchecked,debugging"
|
|
|
|
- "--features testing-environ,no_time,no_function,no_float,no_position,no_index,no_object,no_optimize,no_module,no_closure,no_custom_syntax,unchecked"
|
2020-07-25 10:02:06 +02:00
|
|
|
toolchain: [stable]
|
|
|
|
experimental: [false]
|
|
|
|
include:
|
2022-09-10 08:09:55 +02:00
|
|
|
# smoketests for different toolchains
|
2020-07-25 10:02:06 +02:00
|
|
|
- {toolchain: stable, os: windows-latest, experimental: false, flags: ""}
|
|
|
|
- {toolchain: stable, os: macos-latest, experimental: false, flags: ""}
|
2022-11-04 15:21:21 +01:00
|
|
|
- {toolchain: beta, os: ubuntu-latest, experimental: false, flags: ""}
|
|
|
|
- {toolchain: nightly, os: ubuntu-latest, experimental: true, flags: ""}
|
2020-08-07 02:09:13 +02:00
|
|
|
fail-fast: false
|
2020-07-25 10:02:06 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-01-31 18:37:37 +01:00
|
|
|
uses: actions/checkout@v4
|
2020-07-25 10:02:06 +02:00
|
|
|
- name: Setup Toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{matrix.toolchain}}
|
|
|
|
override: true
|
|
|
|
- name: Test
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
2020-09-08 23:24:08 +02:00
|
|
|
args: ${{matrix.flags}}
|
2022-10-12 08:49:05 +02:00
|
|
|
|
2020-07-25 10:02:06 +02:00
|
|
|
# no-std builds are a bit more extensive to test
|
|
|
|
no_std_build:
|
|
|
|
name: NoStdBuild
|
|
|
|
runs-on: ${{matrix.os}}
|
2020-07-25 10:48:29 +02:00
|
|
|
continue-on-error: ${{matrix.experimental}}
|
2020-07-25 10:02:06 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-07-25 10:48:29 +02:00
|
|
|
include:
|
2022-01-22 10:27:18 +01:00
|
|
|
- {os: ubuntu-latest, flags: "--profile unix", experimental: false}
|
|
|
|
- {os: windows-latest, flags: "--profile windows", experimental: true}
|
2023-04-10 07:18:45 +02:00
|
|
|
#- {os: macos-latest, flags: "--profile macos", experimental: false}
|
2020-07-25 10:02:06 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-01-31 18:37:37 +01:00
|
|
|
uses: actions/checkout@v4
|
2020-07-25 10:02:06 +02:00
|
|
|
- name: Setup Toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
|
|
|
- name: Build Project
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
2020-07-25 10:48:29 +02:00
|
|
|
args: --manifest-path=no_std/no_std_test/Cargo.toml ${{matrix.flags}}
|
2022-10-12 08:49:05 +02:00
|
|
|
|
2022-10-11 10:29:48 +02:00
|
|
|
wasm:
|
|
|
|
name: Check Wasm build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
flags:
|
2022-10-12 08:49:05 +02:00
|
|
|
- "--target wasm32-wasi"
|
2022-10-11 12:06:22 +02:00
|
|
|
# These fail currently, future PR should fix them
|
2022-10-12 08:49:05 +02:00
|
|
|
# - "--target wasm32-unknown-unknown"
|
|
|
|
# - "--target wasm32-unknown-unknown --features wasm-bindgen"
|
|
|
|
- "--target wasm32-unknown-unknown --no-default-features"
|
|
|
|
- "--target wasm32-unknown-unknown --no-default-features --features wasm-bindgen"
|
2022-10-11 10:29:48 +02:00
|
|
|
fail-fast: false
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-01-31 18:37:37 +01:00
|
|
|
uses: actions/checkout@v4
|
2022-10-12 09:14:10 +02:00
|
|
|
- name: Setup Generic Wasm Toolchain
|
2022-10-11 10:29:48 +02:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-10-12 09:14:10 +02:00
|
|
|
toolchain: stable
|
2022-10-11 10:29:48 +02:00
|
|
|
override: true
|
|
|
|
target: wasm32-unknown-unknown
|
2022-10-12 08:49:05 +02:00
|
|
|
- name: Setup Wasi Toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-10-12 09:14:10 +02:00
|
|
|
toolchain: stable
|
2022-10-12 08:49:05 +02:00
|
|
|
override: true
|
|
|
|
target: wasm32-wasi
|
2022-10-11 10:29:48 +02:00
|
|
|
- name: Build
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
2022-10-12 08:49:05 +02:00
|
|
|
args: ${{matrix.flags}}
|
2022-10-11 10:29:48 +02:00
|
|
|
|
2020-09-20 19:47:31 +02:00
|
|
|
rustfmt:
|
|
|
|
name: Check Formatting
|
|
|
|
runs-on: windows-latest
|
|
|
|
continue-on-error: true
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-01-31 18:37:37 +01:00
|
|
|
uses: actions/checkout@v4
|
2020-09-20 19:47:31 +02:00
|
|
|
- name: Setup Toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
- name: Run Rustfmt
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|
2020-09-20 20:11:15 +02:00
|
|
|
- name: Run Clippy
|
2020-09-20 19:47:31 +02:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: clippy
|
2020-09-20 20:11:15 +02:00
|
|
|
args: --all -- -Aclippy::all -Dclippy::perf
|
2022-10-12 08:49:05 +02:00
|
|
|
|
2020-08-01 18:52:26 +02:00
|
|
|
codegen_build:
|
|
|
|
name: Codegen Build
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
continue-on-error: ${{matrix.experimental}}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
2022-12-16 02:59:56 +01:00
|
|
|
- {toolchain: stable, os: ubuntu-latest, experimental: false, flags: "--features metadata"}
|
|
|
|
- {toolchain: stable, os: windows-latest, experimental: false, flags: "--features metadata"}
|
2020-08-01 18:52:26 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-01-31 18:37:37 +01:00
|
|
|
uses: actions/checkout@v4
|
2020-08-01 18:52:26 +02:00
|
|
|
- name: Setup Toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{matrix.toolchain}}
|
|
|
|
override: true
|
|
|
|
- name: Build Project
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --manifest-path=codegen/Cargo.toml ${{matrix.flags}}
|