From 6adc5eb9fbf50af6287de12709ce84dff990d5c6 Mon Sep 17 00:00:00 2001 From: Kenneth Loeffler Date: Tue, 2 Jan 2024 15:49:24 -0800 Subject: [PATCH 1/2] Conserve CI minutes via cache, skip macOS+Windows MSRV builds (#827) Windows and macOS runners consume GitHub Actions minutes at [2x and 10x the rate of Linux runners, respectively](https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#minute-multipliers). This is a bit concerning now that there are two Windows jobs and two macOS jobs, introduced in #825. This PR aims to reduce the cost by: * Adding [rust-cache](https://github.com/Swatinem/rust-cache/) to reduce the amount of time spent. I'm aware there were some concerns raised about CI caches in general in #496 - are they still a blocker? * Removing the unnecessary Windows and macOS MSRV build jobs. If an MSRV build fails on one platform due to usage of new language features, then it will fail on all of them. @Kampfkarren may have to change this repository's required status checks before this PR can be merged --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9a39481..17205587 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,6 @@ jobs: strategy: matrix: - rust_version: [stable, 1.70.0] os: [ubuntu-latest, windows-latest, macos-latest] steps: @@ -27,10 +26,13 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: ${{ matrix.rust_version }} + toolchain: stable override: true profile: minimal + - name: Rust cache + uses: Swatinem/rust-cache@v2 + - name: Setup Aftman uses: ok-nick/setup-aftman@v0.3.0 with: @@ -42,6 +44,33 @@ jobs: - name: Test run: cargo test --locked --verbose + msrv: + name: Check MSRV + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.70.0 + override: true + profile: minimal + + - name: Rust cache + uses: Swatinem/rust-cache@v2 + + - name: Setup Aftman + uses: ok-nick/setup-aftman@v0.3.0 + with: + version: 'v0.2.7' + + - name: Build + run: cargo build --locked --verbose + lint: name: Rustfmt, Clippy, & Stylua runs-on: ubuntu-latest @@ -58,6 +87,9 @@ jobs: override: true components: rustfmt, clippy + - name: Rust cache + uses: Swatinem/rust-cache@v2 + - name: Setup Aftman uses: ok-nick/setup-aftman@v0.3.0 with: From 269272983b583a192af1b0be8e553bbd2f25ef9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F?= <34089907+Barocena@users.noreply.github.com> Date: Sat, 6 Jan 2024 03:00:49 +0300 Subject: [PATCH 2/2] Changed file extensions of init command from lua to luau (#831) --- .editorconfig | 3 +++ CHANGELOG.md | 4 +++- .../{src-init.lua => src-init.luau} | 0 .../end_to_end__tests__build__server_init.snap | 2 +- ...ocalScript.client.lua => localScript.client.luau} | 0 .../folder1/{test.server.lua => test.server.luau} | 0 .../folder3/{test.server.lua => test.server.luau} | 0 .../folder/{hello.server.lua => hello.server.luau} | 0 ...verScript.server.lua => serverScript.server.luau} | 0 .../build-tests/server_init/folder/init.server.lua | 1 - .../build-tests/server_init/folder/init.server.luau | 1 + src/cli/init.rs | 12 ++++++------ test-projects/plugins/default.project.json | 2 +- .../plugins/{test-plugin.lua => test-plugin.luau} | 0 14 files changed, 15 insertions(+), 10 deletions(-) rename assets/default-model-project/{src-init.lua => src-init.luau} (100%) rename rojo-test/build-tests/client_in_folder/folder/{localScript.client.lua => localScript.client.luau} (100%) rename rojo-test/build-tests/nested_runcontext/folder1/{test.server.lua => test.server.luau} (100%) rename rojo-test/build-tests/nested_runcontext/folder2/folder3/{test.server.lua => test.server.luau} (100%) rename rojo-test/build-tests/script_meta_disabled/folder/{hello.server.lua => hello.server.luau} (100%) rename rojo-test/build-tests/server_in_folder/folder/{serverScript.server.lua => serverScript.server.luau} (100%) delete mode 100644 rojo-test/build-tests/server_init/folder/init.server.lua create mode 100644 rojo-test/build-tests/server_init/folder/init.server.luau rename test-projects/plugins/{test-plugin.lua => test-plugin.luau} (100%) diff --git a/.editorconfig b/.editorconfig index aa7f61e9..42639a34 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,4 +23,7 @@ insert_final_newline = true insert_final_newline = true [*.lua] +indent_style = tab + +[*.luau] indent_style = tab \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8021fac9..ba305c50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,12 @@ ## Unreleased Changes * Improved the visualization for array properties like Tags ([#829]) -* Significantly improved performance of `rojo serve`, `rojo build --watch`, and `rojo sourcemap --watch` on macOS. [#830] +* Significantly improved performance of `rojo serve`, `rojo build --watch`, and `rojo sourcemap --watch` on macOS. ([#830]) +* Changed *.lua files that init command generates to *.luau ([#831]) [#829]: https://github.com/rojo-rbx/rojo/pull/829 [#830]: https://github.com/rojo-rbx/rojo/pull/830 +[#831]: https://github.com/rojo-rbx/rojo/pull/831 ## [7.4.0-rc3] - October 25, 2023 * Changed `sourcemap --watch` to only generate the sourcemap when it's necessary ([#800]) diff --git a/assets/default-model-project/src-init.lua b/assets/default-model-project/src-init.luau similarity index 100% rename from assets/default-model-project/src-init.lua rename to assets/default-model-project/src-init.luau diff --git a/rojo-test/build-test-snapshots/end_to_end__tests__build__server_init.snap b/rojo-test/build-test-snapshots/end_to_end__tests__build__server_init.snap index 5858d5e0..2bbda073 100644 --- a/rojo-test/build-test-snapshots/end_to_end__tests__build__server_init.snap +++ b/rojo-test/build-test-snapshots/end_to_end__tests__build__server_init.snap @@ -7,7 +7,7 @@ expression: contents server_init 0 - return "From folder/init.server.lua" + return "From folder/init.server.luau" diff --git a/rojo-test/build-tests/client_in_folder/folder/localScript.client.lua b/rojo-test/build-tests/client_in_folder/folder/localScript.client.luau similarity index 100% rename from rojo-test/build-tests/client_in_folder/folder/localScript.client.lua rename to rojo-test/build-tests/client_in_folder/folder/localScript.client.luau diff --git a/rojo-test/build-tests/nested_runcontext/folder1/test.server.lua b/rojo-test/build-tests/nested_runcontext/folder1/test.server.luau similarity index 100% rename from rojo-test/build-tests/nested_runcontext/folder1/test.server.lua rename to rojo-test/build-tests/nested_runcontext/folder1/test.server.luau diff --git a/rojo-test/build-tests/nested_runcontext/folder2/folder3/test.server.lua b/rojo-test/build-tests/nested_runcontext/folder2/folder3/test.server.luau similarity index 100% rename from rojo-test/build-tests/nested_runcontext/folder2/folder3/test.server.lua rename to rojo-test/build-tests/nested_runcontext/folder2/folder3/test.server.luau diff --git a/rojo-test/build-tests/script_meta_disabled/folder/hello.server.lua b/rojo-test/build-tests/script_meta_disabled/folder/hello.server.luau similarity index 100% rename from rojo-test/build-tests/script_meta_disabled/folder/hello.server.lua rename to rojo-test/build-tests/script_meta_disabled/folder/hello.server.luau diff --git a/rojo-test/build-tests/server_in_folder/folder/serverScript.server.lua b/rojo-test/build-tests/server_in_folder/folder/serverScript.server.luau similarity index 100% rename from rojo-test/build-tests/server_in_folder/folder/serverScript.server.lua rename to rojo-test/build-tests/server_in_folder/folder/serverScript.server.luau diff --git a/rojo-test/build-tests/server_init/folder/init.server.lua b/rojo-test/build-tests/server_init/folder/init.server.lua deleted file mode 100644 index 30d3d49a..00000000 --- a/rojo-test/build-tests/server_init/folder/init.server.lua +++ /dev/null @@ -1 +0,0 @@ -return "From folder/init.server.lua" \ No newline at end of file diff --git a/rojo-test/build-tests/server_init/folder/init.server.luau b/rojo-test/build-tests/server_init/folder/init.server.luau new file mode 100644 index 00000000..196105d7 --- /dev/null +++ b/rojo-test/build-tests/server_init/folder/init.server.luau @@ -0,0 +1 @@ +return "From folder/init.server.luau" \ No newline at end of file diff --git a/src/cli/init.rs b/src/cli/init.rs index 48d513b1..5f861470 100644 --- a/src/cli/init.rs +++ b/src/cli/init.rs @@ -13,7 +13,7 @@ use super::resolve_path; static MODEL_PROJECT: &str = include_str!("../../assets/default-model-project/default.project.json"); static MODEL_README: &str = include_str!("../../assets/default-model-project/README.md"); -static MODEL_INIT: &str = include_str!("../../assets/default-model-project/src-init.lua"); +static MODEL_INIT: &str = include_str!("../../assets/default-model-project/src-init.luau"); static MODEL_GIT_IGNORE: &str = include_str!("../../assets/default-model-project/gitignore.txt"); static PLACE_PROJECT: &str = @@ -116,17 +116,17 @@ fn init_place(base_path: &Path, project_params: ProjectParams) -> anyhow::Result fs::create_dir_all(src.join(&src_client))?; write_if_not_exists( - &src_shared.join("Hello.lua"), + &src_shared.join("Hello.luau"), "return function()\n\tprint(\"Hello, world!\")\nend", )?; write_if_not_exists( - &src_server.join("init.server.lua"), + &src_server.join("init.server.luau"), "print(\"Hello world, from server!\")", )?; write_if_not_exists( - &src_client.join("init.client.lua"), + &src_client.join("init.client.luau"), "print(\"Hello world, from client!\")", )?; @@ -149,7 +149,7 @@ fn init_model(base_path: &Path, project_params: ProjectParams) -> anyhow::Result fs::create_dir_all(&src)?; let init = project_params.render_template(MODEL_INIT); - write_if_not_exists(&src.join("init.lua"), &init)?; + write_if_not_exists(&src.join("init.luau"), &init)?; let git_ignore = project_params.render_template(MODEL_GIT_IGNORE); try_git_init(base_path, &git_ignore)?; @@ -170,7 +170,7 @@ fn init_plugin(base_path: &Path, project_params: ProjectParams) -> anyhow::Resul fs::create_dir_all(&src)?; write_if_not_exists( - &src.join("init.server.lua"), + &src.join("init.server.luau"), "print(\"Hello world, from plugin!\")\n", )?; diff --git a/test-projects/plugins/default.project.json b/test-projects/plugins/default.project.json index 02387e7e..4ca44a88 100644 --- a/test-projects/plugins/default.project.json +++ b/test-projects/plugins/default.project.json @@ -4,6 +4,6 @@ "$path": "src" }, "plugins": [ - "test-plugin.lua" + "test-plugin.luau" ] } \ No newline at end of file diff --git a/test-projects/plugins/test-plugin.lua b/test-projects/plugins/test-plugin.luau similarity index 100% rename from test-projects/plugins/test-plugin.lua rename to test-projects/plugins/test-plugin.luau