2626
2727env :
2828 GDEXT_FEATURES : ' godot-core/convenience'
29+ GDEXT_CRATE_ARGS : ' -p godot-codegen -p godot-ffi -p godot-core -p godot-macros -p godot'
2930
3031defaults :
3132 run :
@@ -37,51 +38,86 @@ defaults:
3738# cancel-in-progress: true
3839
3940jobs :
40- # rustfmt:
41- # runs-on: ubuntu-latest
42- # steps:
43- # - uses: actions/checkout@v3
44- # - name: "Install Rust"
45- # uses: ./.github/composite/rust
46- # with:
47- # rust: stable
48- # components: rustfmt
49- # - name: "Check rustfmt"
50- # run: cargo fmt --all -- --check
51-
52- # unit-test:
53- # runs-on: ubuntu-latest
54- # steps:
55- # - uses: actions/checkout@v3
56- # - name: "Install Rust"
57- # uses: ./.github/composite/rust
58- #
59- # # TODO seems unneeded in GDNative...?
60- # - name: "Install LLVM"
61- # uses: ./.github/composite/llvm
62- #
63- # - name: "Compile tests"
64- # run: cargo test --workspace --features ${GDEXT_FEATURES} --no-run
65- #
66- # - name: "Test"
67- # run: cargo test --workspace --features ${GDEXT_FEATURES}
41+ rustfmt :
42+ runs-on : ubuntu-20.04
43+ steps :
44+ - uses : actions/checkout@v3
45+ - name : " Install Rust"
46+ uses : ./.github/composite/rust
47+ with :
48+ rust : stable
49+ components : rustfmt
50+ - name : " Check rustfmt"
51+ run : cargo fmt --all -- --check
52+
53+ unit-test :
54+ name : test (${{ matrix.name }})
55+ runs-on : ${{ matrix.os }}
56+ continue-on-error : false
57+ strategy :
58+ fail-fast : false # cancel all jobs as soon as one fails?
59+ matrix :
60+ # Order this way because macOS typically has the longest duration, followed by Windows, so it benefits total workflow execution time.
61+ # Additionally, the 'linux (msrv *)' special case will then be listed next to the other 'linux' jobs.
62+ # Note: Windows uses '--target x86_64-pc-windows-msvc' by default as Cargo argument.
63+ include :
64+ - name : macos
65+ os : macos-11
66+ rust-toolchain : stable
67+
68+ - name : windows
69+ os : windows-latest
70+ rust-toolchain : stable-x86_64-pc-windows-msvc
71+
72+ # Don't use latest Ubuntu (22.04) as it breaks lots of ecosystem compatibility.
73+ # If ever moving to ubuntu-latest, need to manually install libtinfo5 for LLVM.
74+ - name : linux
75+ os : ubuntu-20.04
76+ rust-toolchain : stable
77+
78+ steps :
79+ - uses : actions/checkout@v3
80+
81+ - name : " Install Rust"
82+ uses : ./.github/composite/rust
83+
84+ - name : " Install minimal dependency versions from Cargo"
85+ run : cargo +nightly update -Z minimal-versions
86+ if : ${{ matrix.rust.special == 'minimal-deps' }}
87+
88+ - name : " Install Rust"
89+ uses : ./.github/composite/rust
90+ with :
91+ rust : stable
92+ cache-key : ${{ matrix.rust.special }} # 'minimal-deps' or empty/not defined
93+
94+ - name : " Install LLVM"
95+ uses : ./.github/composite/llvm
96+ if : matrix.name == 'macos'
97+
98+ - name : " Compile tests"
99+ run : cargo test $GDEXT_CRATE_ARGS --features unit-test,$GDEXT_FEATURES --no-run
100+
101+ - name : " Test"
102+ run : cargo test $GDEXT_CRATE_ARGS --features unit-test,$GDEXT_FEATURES ${{ matrix.testflags }}
103+
68104
69105 integration-test-godot :
70- name : itest-godot-${{ matrix.name }}
71- timeout-minutes : 15
106+ name : itest-godot (${{ matrix.name }})
72107 runs-on : ${{ matrix.os }}
73108 continue-on-error : false
109+ timeout-minutes : 24
74110 strategy :
75111 fail-fast : false # cancel all jobs as soon as one fails?
76112 matrix :
77113 # Order this way because macOS typically has the longest duration, followed by Windows, so it benefits total workflow execution time.
78114 # Additionally, the 'linux (msrv *)' special case will then be listed next to the other 'linux' jobs.
79115 # Note: Windows uses '--target x86_64-pc-windows-msvc' by default as Cargo argument.
80116 include :
81- # - name: macos
82- # os: macos-12
83- # rust-toolchain: stable
84- # godot-binary: godot.macos.editor.dev.x86_64
117+ - name : macos
118+ os : macos-12
119+ rust-toolchain : stable
120+ godot-binary : godot.macos.editor.dev.x86_64
85121
86122 - name : windows
87123 os : windows-latest
@@ -106,7 +142,7 @@ jobs:
106142 # godot_ver: ${{ matrix.godot }}
107143
108144 license-guard :
109- runs-on : ubuntu-latest
145+ runs-on : ubuntu-20.04
110146 if : github.ref != 'refs/heads/master'
111147 steps :
112148 - uses : actions/checkout@v3
0 commit comments