Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cross-platform CI.yml #111

Merged
merged 17 commits into from
Apr 5, 2024
135 changes: 135 additions & 0 deletions .github/workflows/bevy_api_gen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
on:
pull_request:
paths:
- "crates/bevy_api_gen/**"
push:
branches:
- main
paths:
- "crates/bevy_api_gen/**"


name: Check and Lint - bevy_api_gen

jobs:
check:
name: Check - bevy_api_gen
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
sparse-checkout: 'crates/bevy_api_gen'
sparse-checkout-cone-mode: false
- name: Move bevy_api_gen to root
run: |
mv crates/bevy_api_gen/* .
rm -rf crates
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2024-01-24
override: true
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Clear space
run: rm -rf /usr/share/dotnet; rm -rf /opt/ghc; rm -rf "/usr/local/share/boost"; rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions-rs/cargo@v1
with:
command: check
args: --profile=ephemeral-build

fmt:
name: Rustfmt - bevy_api_gen
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
sparse-checkout: 'crates/bevy_api_gen'
sparse-checkout-cone-mode: false
- name: Move bevy_api_gen to root
run: |
mv crates/bevy_api_gen/* .
rm -rf crates
- uses: actions-rs/toolchain@v1
with:
profile: minimal
components: rustfmt
toolchain: nightly-2024-01-24
override: true
- name: Rust Cache
uses: Swatinem/[email protected]
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy - bevy_api_gen
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
sparse-checkout: 'crates/bevy_api_gen'
sparse-checkout-cone-mode: false
- name: Move bevy_api_gen to root
run: |
mv crates/bevy_api_gen/* .
rm -rf crates
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-01-24
components: clippy
override: true
- name: Rust Cache
uses: Swatinem/[email protected]
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --profile=ephemeral-build -- -D warnings
tests:
name: Tests - bevy_api_gen
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
sparse-checkout: 'crates/bevy_api_gen'
sparse-checkout-cone-mode: false
- name: Move bevy_api_gen to root
run: |
mv crates/bevy_api_gen/* .
rm -rf crates
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-01-24
override: true
- name: Rust Cache
uses: Swatinem/[email protected]
- uses: actions-rs/cargo@v1
with:
command: test
args: --profile=ephemeral-build
docs:
name: Docs - bevy_api_gen
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
sparse-checkout: 'crates/bevy_api_gen'
sparse-checkout-cone-mode: false
- name: Move bevy_api_gen to root
run: |
mv crates/bevy_api_gen/* .
rm -rf crates
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-01-24
override: true
- name: Rust Cache
uses: Swatinem/[email protected]
# - name: Find docs.rs features
# run: echo "DOCS_FEATURES=$(cargo metadata --no-deps | python -c "import sys,json; [print(','.join(x['metadata']['docs.rs']['features'])) for x in json.load(sys.stdin)['packages'] if x['name'] == 'bevy_mod_scripting']")" >> $GITHUB_OUTPUT
# id: features
- uses: actions-rs/cargo@v1
with:
command: doc
args: --profile=ephemeral-build
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
on:
pull_request:
paths-ignore:
- 'crates/bevy_api_gen/**'
- 'crates/macro_tests/**'
push:
branches:
- main
paths-ignore:
- 'crates/bevy_api_gen/**'
- 'crates/macro_tests/**'


name: Check and Lint
name: Check and Lint - bevy_mod_scripting

jobs:
check:
Expand All @@ -14,20 +20,20 @@ jobs:
strategy:
matrix:
run_args: [
{os: windows-latest, lua: lua54, cross: null},
{os: macOS-latest, lua: lua54, cross: null},
# {os: ubuntu-latest, lua: lua54, cross: aarch64-unknown-linux-gnu}, see https://github.com/houseabsolute/actions-rust-cross/issues/15
{os: ubuntu-latest, lua: lua51, cross: null},
{os: ubuntu-latest, lua: lua52, cross: null},
{os: ubuntu-latest, lua: lua53, cross: null},
{os: ubuntu-latest, lua: lua54, cross: null},
{os: ubuntu-latest, lua: luajit, cross: null},
{os: ubuntu-latest, lua: luajit52, cross: null}
{os: windows-latest, lua: lua54, cross: x86_64-pc-windows-msvc},
{os: macOS-latest, lua: lua54, cross: x86_64-apple-darwin},
{os: ubuntu-latest, lua: lua54, cross: aarch64-unknown-linux-gnu},
{os: ubuntu-latest, lua: lua51, cross: x86_64-unknown-linux-gnu},
{os: ubuntu-latest, lua: lua52, cross: x86_64-unknown-linux-gnu},
{os: ubuntu-latest, lua: lua53, cross: x86_64-unknown-linux-gnu},
{os: ubuntu-latest, lua: lua54, cross: x86_64-unknown-linux-gnu},
{os: ubuntu-latest, lua: luajit, cross: x86_64-unknown-linux-gnu},
{os: ubuntu-latest, lua: luajit52, cross: x86_64-unknown-linux-gnu}
]
steps:
- name: Install alsa and udev
- if: runner.os == 'linux'
name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
if: runner.os == 'linux'
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
Expand All @@ -36,18 +42,10 @@ jobs:
override: true
- name: Rust Cache
uses: Swatinem/[email protected]
# for x86 builds
- if: matrix.run_args.cross == null
uses: actions-rs/cargo@v1
with:
command: check
args: --workspace --features=${{ matrix.run_args.lua }},rhai,teal,lua_script_api,rhai_script_api,rune
# for non x86 cross-compiled builds
- if: matrix.run_args.cross != null
- if: runner.os != 'windows'
name: Clear space
run: sudo rm -rf /usr/share/dotnet; sudo rm -rf /opt/ghc; sudo rm -rf "/usr/local/share/boost"; sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- if: matrix.run_args.cross != null
uses: houseabsolute/actions-rust-cross@v0
run: rm -rf /usr/share/dotnet; rm -rf /opt/ghc; rm -rf "/usr/local/share/boost"; rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: houseabsolute/actions-rust-cross@v0
with:
command: check
target: ${{ matrix.run_args.cross }}
Expand Down Expand Up @@ -101,7 +99,6 @@ jobs:
uses: actions/checkout@v3
- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/macro_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
pull_request:
paths:
- "crates/macro_tests/**"
push:
branches:
- main
paths:
- "crates/macro_tests/**"


name: Run macro tests

jobs:
tests:
name: Macro Tests
runs-on: ubuntu-latest
steps:
- name: Clear space
run: sudo rm -rf /usr/share/dotnet; sudo rm -rf /opt/ghc; sudo rm -rf "/usr/local/share/boost"; sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v3
- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Rust Cache
uses: Swatinem/[email protected]
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: cd crates/macro_tests && cargo test --profile=ephemeral-build
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"rust-analyzer.rustc.source": "discover",
"rust-analyzer.linkedProjects": [
"./crates/bevy_api_gen/Cargo.toml",
// "./crates/macro_tests/Cargo.toml",
"Cargo.toml",
],
"rust-analyzer.check.invocationStrategy": "per_workspace",
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ members = [
"crates/bevy_mod_scripting_common",
]
resolver = "2"
exclude = ["bevy_api_gen"]
exclude = ["crates/bevy_api_gen", "crates/macro_tests"]

[profile.dev]
debug = 1
Expand Down
6 changes: 6 additions & 0 deletions crates/bevy_api_gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ path = "src/bin/main.rs"
name = "bevy-api-gen-driver"
path = "src/bin/driver.rs"

[profile.ephemeral-build]
inherits = "dev"
opt-level = 2
codegen-units = 8
incremental = false
debug = false

[rust-analyzer.rustc]
source = "discover"
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_api_gen/clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type-complexity-threshold=1000
Loading
Loading