diff --git a/.github/workflows/dispatcher.yml b/.github/workflows/dispatcher.yml new file mode 100644 index 0000000..10e64fd --- /dev/null +++ b/.github/workflows/dispatcher.yml @@ -0,0 +1,65 @@ +name: Dispatcher + +on: + push: + branches: + - '**' # minden branchre lefut + +jobs: + detect-and-dispatch: + runs-on: self-hosted # (sajat rpi-on fusson) + + steps: + - name: Detect project from branch name + id: detect + run: | + BRANCH_NAME=${GITHUB_REF##*/} + echo "Branch name: $BRANCH_NAME" + + if [[ "$BRANCH_NAME" == Engine/* ]]; then + echo "project=Engine" >> $GITHUB_OUTPUT + elif [[ "$BRANCH_NAME" == Server/* ]]; then + echo "project=Server" >> $GITHUB_OUTPUT + elif [[ "$BRANCH_NAME" == UI/* ]]; then + echo "project=UI" >> $GITHUB_OUTPUT + else + echo "project=unknown" >> $GITHUB_OUTPUT + fi + + - name: Trigger Engine tests + if: steps.detect.outputs.project == 'Engine' + uses: peter-evans/workflow-dispatch@v2 + with: + workflow: "engine_test.yml" + ref: ${{ github.ref }} + + - name: Trigger Server tests + if: steps.detect.outputs.project == 'Server' + uses: peter-evans/workflow-dispatch@v2 + with: + workflow: "server_test.yml" + ref: ${{ github.ref }} + + - name: Trigger UI tests + if: steps.detect.outputs.project == 'UI' + uses: peter-evans/workflow-dispatch@v2 + with: + workflow: "ui_test.yml" + ref: ${{ github.ref }} + + - name: Trigger all tests (main/master) + if: github.ref_name == 'main' || github.ref_name == 'master' + uses: peter-evans/workflow-dispatch@v2 + with: + workflow: "engine_test.yml" + ref: ${{ github.ref }} + - uses: peter-evans/workflow-dispatch@v2 + if: github.ref_name == 'main' || github.ref_name == 'master' + with: + workflow: "server_test.yml" + ref: ${{ github.ref }} + - uses: peter-evans/workflow-dispatch@v2 + if: github.ref_name == 'main' || github.ref_name == 'master' + with: + workflow: "ui_test.yml" + ref: ${{ github.ref }} diff --git a/.github/workflows/engine_test.yml b/.github/workflows/engine_test.yml new file mode 100644 index 0000000..d9b5b6f --- /dev/null +++ b/.github/workflows/engine_test.yml @@ -0,0 +1,22 @@ +name: Engine Tests + +on: + workflow_dispatch: + +jobs: + engine-tests: + runs-on: self-hosted + + steps: + - uses: actions/checkout@v4 + + - name: Set up Rust + uses: actions/setup-rust@v1 + with: + rust-version: stable + + - name: Run Engine tests + run: | + cd engine + ls + cargo test --verbose diff --git a/.gitub/workflows/placeholder.txt b/.gitub/workflows/placeholder.txt deleted file mode 100644 index e69de29..0000000