Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MassivDash authored Mar 6, 2025
0 parents commit 764e9a8
Show file tree
Hide file tree
Showing 135 changed files with 18,266 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
48 changes: 48 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CodeQL

on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: "31 7 * * 3"

permissions:
actions: read
checks: write
contents: read
security-events: write

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language:
- TypeScript

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
id: initialize
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
source-root: src

- name: Autobuild
id: autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@v3
122 changes: 122 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
# Required to checkout the code
contents:
read
# Required to put a comment into the pull-request
pull-requests: write
jobs:
test_rust:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable
- name: Install rust dependencies
run: |
cargo install cargo-watch
cargo install commitlint-rs
- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
- name: Install Frontend dependencies
run: |
cd src/frontend
npm install
- name: Test Cli (Astro_X_Runner)
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcovCli.info --manifest-path Cargo.toml
- name: Report code coverage
if: matrix.os == 'macOS-latest'
uses: zgosalvez/[email protected]
with:
coverage-files: lcovCli.info
artifact-name: code-coverage-cli-report
github-token: ${{ secrets.GITHUB_TOKEN }}
update-comment: true
title-prefix: "CLI"
- name: Test Backend
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcovBackend.info --manifest-path src/backend/Cargo.toml

- name: Report code coverage
if: matrix.os == 'macOS-latest'
uses: zgosalvez/[email protected]
with:
coverage-files: lcovBackend.info
artifact-name: code-coverage-backend-report
github-token: ${{ secrets.GITHUB_TOKEN }}
update-comment: true
title-prefix: "Backend"
- name: Run Project Build
run: cargo run -- --build
test_frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
- name: Install dependencies
run: |
cd src/frontend
npm install
- name: npm audit report
run: |
cd src/frontend
npm audit --json | npx @netly/npm-audit-markdown --output npm.md
- name: "Test"
run: |
cd src/frontend
npm run coverage
- name: Run project analyzer
run: npm i -g project-analyzer && projectAnalyzer -m -t
- name: "Report Coverage"
# Set if: always() to also generate the report if tests are failing
# Only works if you set `reportOnFailure: true` in your vite config as specified above
uses: davelosert/vitest-coverage-report-action@v2
with:
json-summary-path: src/frontend/coverage/coverage-summary.json

- name: Post coverage summary
id: coverage_summary
uses: irongut/[email protected]
with:
filename: src/frontend/coverage/cobertura-coverage.xml
badge: true
format: markdown
output: both

- name: Add Npm audit report PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: src/frontend/npm.md

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
- name: Add Project Analysis PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: analysis.md
108 changes: 108 additions & 0 deletions .github/workflows/relase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Release

on:
push:
branches:
- main

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable
- name: Install rust dependencies
run: |
cargo install cargo-watch
cargo install commitlint-rs
- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
- name: Install Frontend dependencies
run: |
cd src/frontend
npm install
- name: Coverage Frontend
run: |
cd src/frontend
npm run coverage
- name: Test cli
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcovCli.info --manifest-path Cargo.toml
- name: Report code coverage
if: matrix.os == 'macOS-latest'
uses: zgosalvez/[email protected]
with:
coverage-files: lcovCli.info
artifact-name: code-coverage-cli-report
github-token: ${{ secrets.GITHUB_TOKEN }}
update-comment: true
title-prefix: "CLI"
- name: Test Backend
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcovBackend.info --manifest-path src/backend/Cargo.toml
- name: Report code coverage
if: matrix.os == 'macOS-latest'
uses: zgosalvez/[email protected]
with:
coverage-files: lcovBackend.info
artifact-name: code-coverage-backend-report
github-token: ${{ secrets.GITHUB_TOKEN }}
update-comment: true
title-prefix: "BACKEND"
- name: Run Project Build
run: cargo run -- --build --prod-astro-build=true
- name: Package Artifacts (Linux)
if: matrix.os == 'linux-latest'
run: |
zip -r artifacts_linux.zip .
mkdir -p artifacts
mv artifacts_linux.zip artifacts/
- name: Package Artifacts (Mac)
if: matrix.os == 'macOs-latest'
run: |
zip -r artifacts_macos.zip .
mkdir -p artifacts
mv artifacts_macos.zip artifacts/
- name: Package Artifacts (Windows)
if: matrix.os == 'window-latest'
run: |
Compress-Archive -Path . -DestinationPath artifacts\artifacts_windows.zip
mkdir artifacts
copy artifacts_windows.zip artifacts\
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: artifacts/

release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/[email protected]
with:
name: build-artifacts
path: artifacts/
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
draft: false
prerelase: false
tag_name: v0.1.2.${{github.run_number}}
files: |
artifacts/arifacts_macos.zip
artifacts/arifacts_windows.zip
artifacts/arifacts_linux.zip
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/target
/src/frontend/dist
/src/backend/target
syncDevil.sh
.env
lcov.info
src/frontend/coverage
src/backend/coverage
coverage
Astrox-test.toml
Cargo.lock
src/backend/Cargo.lock
analysis.md

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.14.1
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["rust-lang.rust-analyzer", "dustypomerleau.rust-syntax"]
}
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/<executable file>",
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"rust-analyzer.linkedProjects": ["./src/backend/Cargo.toml", "./Cargo.toml"],
"editor.formatOnSave": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"astro",
"typescript",
"typescriptreact"
],
"prettier.documentSelectors": ["**/*.astro", "**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.css", "**/*.scss", "**/*.json", "**/*.md"],
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"cSpell.words": [
"nesseccery"
],
}
9 changes: 9 additions & 0 deletions Astrox.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
host = "localhost"
port = 8080
env = "dev"
astro_port = 5431
prod_astro_build = true
cors_url = "https://astrox.spaceout.pl"

[public_keys]
public_api_url = "https://astrox.spaceout.pl/api"
14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "astro_x_runner"
version = "0.1.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
"toml" = "0.8.19"
ctrlc = "3.4.4"
inquire = "0.7.5"
serde = { version = "1.0", features = ["derive"] }
semver = "1.0.23"
crossterm = "0.28"
17 changes: 17 additions & 0 deletions git_hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
echo -e "\e[41m\e[97mRunning commitlint...\e[0m"

commit_message=$(cat "$1")

echo "$commit_message" | commitlint

# If the commit message does not match the conventional commit format, then exit with a non-zero status

if [ $? -ne 0 ]; then
echo -e "\e[41m\e[97mInvalid commit message. Please use the conventional commit format, more info on https://www.conventionalcommits.org/en/v1.0.0/\e[0m"
exit 1
fi

echo -e "\e[42m\e[97m"
echo "----- Done -----"
echo " "
echo -e "\e[0m"
14 changes: 14 additions & 0 deletions git_hooks/commit-msg-windows-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Change the name of this file to commit-msg
# Delete the current linux version

echo Running commitlint...
set /p commit_message=<%1
echo %commit_message% | commitlint
if errorlevel 1 (
echo Invalid commit message. Please use the conventional commit format, more info on https://www.conventionalcommits.org/en/v1.0.0/
exit /b 1
)

echo
echo ----- Done -----
echo
Loading

0 comments on commit 764e9a8

Please sign in to comment.