From 614e17278816c2a1b1a6868e3d9d5f27bf6724a6 Mon Sep 17 00:00:00 2001 From: Pistonight Date: Fri, 29 Sep 2023 20:15:27 -0700 Subject: [PATCH 1/3] add test-rust CI step --- .github/workflows/test.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b50d3300..2df0b604 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,3 +30,19 @@ jobs: - run: task themes:ci client:ci --output group - run: task themes:build build:wasm build:types --output group - run: task client:test + + test-rust: + name: Test Rust Packages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: arduino/setup-task@v1 + with: + version: 3.x + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: dtolnay/rust-toolchain@stable + - uses: baptiste0928/cargo-install@v2 + with: + crate: regen-lang + - run: task core:grammar + - run: cargo test --all-features --all-targets From 3e7a45e7ab47681dddf210bdf8822a774b8edd42 Mon Sep 17 00:00:00 2001 From: Pistonight Date: Fri, 29 Sep 2023 20:26:15 -0700 Subject: [PATCH 2/3] check test can fail --- Justfile | 70 -------------------------- Taskfile.yml | 8 +++ compiler-core/src/exec/exec_section.rs | 2 +- 3 files changed, 9 insertions(+), 71 deletions(-) diff --git a/Justfile b/Justfile index d6fff14b..590d0e1d 100644 --- a/Justfile +++ b/Justfile @@ -1,8 +1,3 @@ -set windows-powershell:=true - -@default: - just --list - # Install development dependencies and packages install: rustup update @@ -13,68 +8,3 @@ install: cargo install regen-lang cd docs && npm i cd web-client && npm i - -# Install dependencies for CI -install-ci: - cargo install cross --git https://github.com/cross-rs/cross - cd docs && npm ci - cd web-client && npm ci - -# Start running txtpp and watch for changes -dev-pp: - cargo watch -s "txtpp verify . -r || txtpp -r" - -# Start hosting the docs locally and watch for changes -dev-docs +FLAGS="": - cd docs && npm run dev -- --host {{FLAGS}} - -# Start the web client locally and watch for changes -dev-client +FLAGS="": - cd web-client && npm run dev -- --host {{FLAGS}} - -# Start the server locally and watch for changes -dev-server +FLAGS="": - cargo watch -B 1 -s "cargo run --bin celerserver -- --docs-dir docs/src/.vitepress/dist {{FLAGS}}" - -# Format the code -fmt: - cargo fmt - cd web-client && npm run fmt -- --write - cd web-client && npm run lint -- --fix - -# Check the code -check: - cargo fmt --check - cargo clippy --all-features --all-targets -- -D warnings -D clippy::todo - cd web-client && npm run fmt -- --check - cd web-client && npm run lint - txtpp verify . -r - -test: - echo "no tests yet" - -# Build the project for release -build: - mkdir -p dist - rm -rf dist/* - #txtpp -r - @echo "Building docs" - cd docs && npm run build - mkdir dist/docs - cp -r docs/src/.vitepress/dist/* dist/docs - @echo "Building server" - rustup default stable - cross build --bin start-server --release --target x86_64-unknown-linux-musl - cp target/x86_64-unknown-linux-musl/release/start-server dist/start-server - @echo "Done - Build outputs saved to dist/" - -container: - docker build -t pistonite/celer . --no-cache - @echo "Run with:" - @echo - @echo "docker run -p 8000:80 pistonite/celer" - -release TAG="latest": - docker login - docker push pistonite/celer:{{TAG}} - docker logout diff --git a/Taskfile.yml b/Taskfile.yml index 353f7807..cc3e2504 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -76,6 +76,14 @@ tasks: cmds: - docker stop $(docker ps -q -a --filter ancestor=pistonite/celer) + docker:push: + desc: Push the container to docker hub. Takes in the tag [defaults to latest] + interactive: true + cmds: + - docker login + - docker push pistonite/celer:{{.CLI_ARGS | default "latest" }} + - docker logout + build: desc: Build production assets deps: diff --git a/compiler-core/src/exec/exec_section.rs b/compiler-core/src/exec/exec_section.rs index 13762d9f..06e1bb67 100644 --- a/compiler-core/src/exec/exec_section.rs +++ b/compiler-core/src/exec/exec_section.rs @@ -199,7 +199,7 @@ mod test { GameCoord(1.0, 2.0, 3.0), GameCoord(1.0, 3.0, 3.0), GameCoord(1.0, 4.0, 3.0), - GameCoord(1.0, 5.0, 3.0), + GameCoord(1.0, 5.0, 4.0), ], }] ); From 08bd5c7956e31a318f730055f4976a19b2767202 Mon Sep 17 00:00:00 2001 From: Pistonight Date: Fri, 29 Sep 2023 20:38:33 -0700 Subject: [PATCH 3/3] remove rest of Justfile --- Justfile | 10 ---------- Taskfile.yml | 11 +++++++++++ compiler-core/src/exec/exec_section.rs | 2 +- web-client/package-lock.json | 9 --------- 4 files changed, 12 insertions(+), 20 deletions(-) delete mode 100644 Justfile diff --git a/Justfile b/Justfile deleted file mode 100644 index 590d0e1d..00000000 --- a/Justfile +++ /dev/null @@ -1,10 +0,0 @@ -# Install development dependencies and packages -install: - rustup update - cargo install cargo-watch - cargo install cross --git https://github.com/cross-rs/cross - cargo install txtpp --features cli - cargo install wasm-pack - cargo install regen-lang - cd docs && npm i - cd web-client && npm i diff --git a/Taskfile.yml b/Taskfile.yml index cc3e2504..fe20d906 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -36,6 +36,17 @@ includes: dir: ./web-themes tasks: + install: + desc: Install development dependencies and packages + cmds: + - rustup update + - cargo install cargo-watch wasm-pack regen-lang + - cargo install cross --git https://github.com/cross-rs/cross + - cargo install txtpp --features cli + - task: themes:install + - task: docs:install + - task: client:install + check: desc: Check issues in all packages deps: [check:ts, check:rs] diff --git a/compiler-core/src/exec/exec_section.rs b/compiler-core/src/exec/exec_section.rs index 06e1bb67..13762d9f 100644 --- a/compiler-core/src/exec/exec_section.rs +++ b/compiler-core/src/exec/exec_section.rs @@ -199,7 +199,7 @@ mod test { GameCoord(1.0, 2.0, 3.0), GameCoord(1.0, 3.0, 3.0), GameCoord(1.0, 4.0, 3.0), - GameCoord(1.0, 5.0, 4.0), + GameCoord(1.0, 5.0, 3.0), ], }] ); diff --git a/web-client/package-lock.json b/web-client/package-lock.json index b7f03abc..b7a1708e 100644 --- a/web-client/package-lock.json +++ b/web-client/package-lock.json @@ -18,7 +18,6 @@ "leaflet": "^1.9.4", "leaflet-arrowheads": "^1.4.0", "leaflet-rastercoords": "^1.0.5", - "lru-cache": "^10.0.0", "monaco-editor": "^0.41.0", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -10651,14 +10650,6 @@ "loose-envify": "cli.js" } }, - "node_modules/lru-cache": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.0.tgz", - "integrity": "sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==", - "engines": { - "node": "14 || >=16.14" - } - }, "node_modules/lz-string": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz",