Skip to content

Commit 7b295ce

Browse files
authored
Fix cross-platform CI.yml (#111)
* Fix cross-platform CI.yml * remove sudo * fix issues in ci * exclude lua54 feature from dev dependencies * adjust workflows * adjust workflows * set default dir * change default dir * checkout subdir * formatting fixes * nightly toolchain set * add clippy.toml * finish fixes to workflows * change checkout strategy * typo * add feature * remove macro_tests from check.sh
1 parent 10dcca9 commit 7b295ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+260
-57
lines changed

.github/workflows/bevy_api_gen.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
on:
2+
pull_request:
3+
paths:
4+
- "crates/bevy_api_gen/**"
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- "crates/bevy_api_gen/**"
10+
11+
12+
name: Check and Lint - bevy_api_gen
13+
14+
jobs:
15+
check:
16+
name: Check - bevy_api_gen
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
with:
21+
sparse-checkout: 'crates/bevy_api_gen'
22+
sparse-checkout-cone-mode: false
23+
- name: Move bevy_api_gen to root
24+
run: |
25+
mv crates/bevy_api_gen/* .
26+
rm -rf crates
27+
- uses: actions-rs/toolchain@v1
28+
with:
29+
profile: minimal
30+
toolchain: nightly-2024-01-24
31+
override: true
32+
- name: Rust Cache
33+
uses: Swatinem/rust-cache@v2.7.3
34+
- name: Clear space
35+
run: rm -rf /usr/share/dotnet; rm -rf /opt/ghc; rm -rf "/usr/local/share/boost"; rm -rf "$AGENT_TOOLSDIRECTORY"
36+
- uses: actions-rs/cargo@v1
37+
with:
38+
command: check
39+
args: --profile=ephemeral-build
40+
41+
fmt:
42+
name: Rustfmt - bevy_api_gen
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v3
46+
with:
47+
sparse-checkout: 'crates/bevy_api_gen'
48+
sparse-checkout-cone-mode: false
49+
- name: Move bevy_api_gen to root
50+
run: |
51+
mv crates/bevy_api_gen/* .
52+
rm -rf crates
53+
- uses: actions-rs/toolchain@v1
54+
with:
55+
profile: minimal
56+
components: rustfmt
57+
toolchain: nightly-2024-01-24
58+
override: true
59+
- name: Rust Cache
60+
uses: Swatinem/rust-cache@v2.7.3
61+
- uses: actions-rs/cargo@v1
62+
with:
63+
command: fmt
64+
args: --all -- --check
65+
66+
clippy:
67+
name: Clippy - bevy_api_gen
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v3
71+
with:
72+
sparse-checkout: 'crates/bevy_api_gen'
73+
sparse-checkout-cone-mode: false
74+
- name: Move bevy_api_gen to root
75+
run: |
76+
mv crates/bevy_api_gen/* .
77+
rm -rf crates
78+
- uses: actions-rs/toolchain@v1
79+
with:
80+
toolchain: nightly-2024-01-24
81+
components: clippy
82+
override: true
83+
- name: Rust Cache
84+
uses: Swatinem/rust-cache@v2.7.3
85+
- uses: actions-rs/cargo@v1
86+
with:
87+
command: clippy
88+
args: --profile=ephemeral-build -- -D warnings
89+
tests:
90+
name: Tests - bevy_api_gen
91+
runs-on: ubuntu-latest
92+
steps:
93+
- uses: actions/checkout@v3
94+
with:
95+
sparse-checkout: 'crates/bevy_api_gen'
96+
sparse-checkout-cone-mode: false
97+
- name: Move bevy_api_gen to root
98+
run: |
99+
mv crates/bevy_api_gen/* .
100+
rm -rf crates
101+
- uses: actions-rs/toolchain@v1
102+
with:
103+
toolchain: nightly-2024-01-24
104+
override: true
105+
- name: Rust Cache
106+
uses: Swatinem/rust-cache@v2.7.3
107+
- uses: actions-rs/cargo@v1
108+
with:
109+
command: test
110+
args: --profile=ephemeral-build
111+
docs:
112+
name: Docs - bevy_api_gen
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: actions/checkout@v3
116+
with:
117+
sparse-checkout: 'crates/bevy_api_gen'
118+
sparse-checkout-cone-mode: false
119+
- name: Move bevy_api_gen to root
120+
run: |
121+
mv crates/bevy_api_gen/* .
122+
rm -rf crates
123+
- uses: actions-rs/toolchain@v1
124+
with:
125+
toolchain: nightly-2024-01-24
126+
override: true
127+
- name: Rust Cache
128+
uses: Swatinem/rust-cache@v2.7.3
129+
# - name: Find docs.rs features
130+
# 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
131+
# id: features
132+
- uses: actions-rs/cargo@v1
133+
with:
134+
command: doc
135+
args: --profile=ephemeral-build

.github/workflows/ci.yml renamed to .github/workflows/bevy_mod_scripting.yml

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
on:
22
pull_request:
3+
paths-ignore:
4+
- 'crates/bevy_api_gen/**'
5+
- 'crates/macro_tests/**'
36
push:
47
branches:
58
- main
9+
paths-ignore:
10+
- 'crates/bevy_api_gen/**'
11+
- 'crates/macro_tests/**'
612

713

8-
name: Check and Lint
14+
name: Check and Lint - bevy_mod_scripting
915

1016
jobs:
1117
check:
@@ -14,20 +20,20 @@ jobs:
1420
strategy:
1521
matrix:
1622
run_args: [
17-
{os: windows-latest, lua: lua54, cross: null},
18-
{os: macOS-latest, lua: lua54, cross: null},
19-
# {os: ubuntu-latest, lua: lua54, cross: aarch64-unknown-linux-gnu}, see https://github.com/houseabsolute/actions-rust-cross/issues/15
20-
{os: ubuntu-latest, lua: lua51, cross: null},
21-
{os: ubuntu-latest, lua: lua52, cross: null},
22-
{os: ubuntu-latest, lua: lua53, cross: null},
23-
{os: ubuntu-latest, lua: lua54, cross: null},
24-
{os: ubuntu-latest, lua: luajit, cross: null},
25-
{os: ubuntu-latest, lua: luajit52, cross: null}
23+
{os: windows-latest, lua: lua54, cross: x86_64-pc-windows-msvc},
24+
{os: macOS-latest, lua: lua54, cross: x86_64-apple-darwin},
25+
{os: ubuntu-latest, lua: lua54, cross: aarch64-unknown-linux-gnu},
26+
{os: ubuntu-latest, lua: lua51, cross: x86_64-unknown-linux-gnu},
27+
{os: ubuntu-latest, lua: lua52, cross: x86_64-unknown-linux-gnu},
28+
{os: ubuntu-latest, lua: lua53, cross: x86_64-unknown-linux-gnu},
29+
{os: ubuntu-latest, lua: lua54, cross: x86_64-unknown-linux-gnu},
30+
{os: ubuntu-latest, lua: luajit, cross: x86_64-unknown-linux-gnu},
31+
{os: ubuntu-latest, lua: luajit52, cross: x86_64-unknown-linux-gnu}
2632
]
2733
steps:
28-
- name: Install alsa and udev
34+
- if: runner.os == 'linux'
35+
name: Install alsa and udev
2936
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
30-
if: runner.os == 'linux'
3137
- uses: actions/checkout@v2
3238
- uses: actions-rs/toolchain@v1
3339
with:
@@ -36,18 +42,10 @@ jobs:
3642
override: true
3743
- name: Rust Cache
3844
uses: Swatinem/rust-cache@v2.7.3
39-
# for x86 builds
40-
- if: matrix.run_args.cross == null
41-
uses: actions-rs/cargo@v1
42-
with:
43-
command: check
44-
args: --workspace --features=${{ matrix.run_args.lua }},rhai,teal,lua_script_api,rhai_script_api,rune
45-
# for non x86 cross-compiled builds
46-
- if: matrix.run_args.cross != null
45+
- if: runner.os != 'windows'
4746
name: Clear space
48-
run: sudo rm -rf /usr/share/dotnet; sudo rm -rf /opt/ghc; sudo rm -rf "/usr/local/share/boost"; sudo rm -rf "$AGENT_TOOLSDIRECTORY"
49-
- if: matrix.run_args.cross != null
50-
uses: houseabsolute/actions-rust-cross@v0
47+
run: rm -rf /usr/share/dotnet; rm -rf /opt/ghc; rm -rf "/usr/local/share/boost"; rm -rf "$AGENT_TOOLSDIRECTORY"
48+
- uses: houseabsolute/actions-rust-cross@v0
5149
with:
5250
command: check
5351
target: ${{ matrix.run_args.cross }}
@@ -101,7 +99,6 @@ jobs:
10199
uses: actions/checkout@v3
102100
- name: Install alsa and udev
103101
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
104-
- uses: actions/checkout@v2
105102
- uses: actions-rs/toolchain@v1
106103
with:
107104
toolchain: stable

.github/workflows/macro_tests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
on:
2+
pull_request:
3+
paths:
4+
- "crates/macro_tests/**"
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- "crates/macro_tests/**"
10+
11+
12+
name: Run macro tests
13+
14+
jobs:
15+
tests:
16+
name: Macro Tests
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Clear space
20+
run: sudo rm -rf /usr/share/dotnet; sudo rm -rf /opt/ghc; sudo rm -rf "/usr/local/share/boost"; sudo rm -rf "$AGENT_TOOLSDIRECTORY"
21+
- uses: actions/checkout@v3
22+
- name: Install alsa and udev
23+
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
24+
- uses: actions-rs/toolchain@v1
25+
with:
26+
toolchain: stable
27+
override: true
28+
- name: Rust Cache
29+
uses: Swatinem/rust-cache@v2.7.3
30+
- uses: actions-rs/toolchain@v1
31+
with:
32+
toolchain: stable
33+
- run: cd crates/macro_tests && cargo test --profile=ephemeral-build

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"rust-analyzer.rustc.source": "discover",
1212
"rust-analyzer.linkedProjects": [
1313
"./crates/bevy_api_gen/Cargo.toml",
14+
// "./crates/macro_tests/Cargo.toml",
1415
"Cargo.toml",
1516
],
1617
"rust-analyzer.check.invocationStrategy": "per_workspace",

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ members = [
9494
"crates/bevy_mod_scripting_common",
9595
]
9696
resolver = "2"
97-
exclude = ["bevy_api_gen"]
97+
exclude = ["crates/bevy_api_gen", "crates/macro_tests"]
9898

9999
[profile.dev]
100100
debug = 1

crates/bevy_api_gen/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ path = "src/bin/main.rs"
2323
name = "bevy-api-gen-driver"
2424
path = "src/bin/driver.rs"
2525

26+
[profile.ephemeral-build]
27+
inherits = "dev"
28+
opt-level = 2
29+
codegen-units = 8
30+
incremental = false
31+
debug = false
2632

2733
[rust-analyzer.rustc]
2834
source = "discover"

crates/bevy_api_gen/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type-complexity-threshold=1000

0 commit comments

Comments
 (0)