Skip to content

Run workflows depending on changed files #444

Run workflows depending on changed files

Run workflows depending on changed files #444

# This file is not auto-generated. Feel free to edit it.
name: ✨ Pull Request
on:
push:
branches:
- develop
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read # Read-only access to repository contents
issues: write # Write access to issues
pull-requests: write # Write access to pull requests
statuses: write # Write access to commit statuses
checks: write
jobs:
gui-changed-files:
runs-on: ubuntu-latest
name: 🔍 GUI files changed
outputs:
all_changed_files: ${{ steps.gui-changed-files.outputs.all_changed_files }}
any_changed: ${{ steps.gui-changed-files.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get changed files
id: gui-changed-files
uses: tj-actions/changed-files@v45
with:
files: |
app/**
package.json
pnpm-lock.yaml
pnpm-workspace.yaml
eslint.config.js
.prettierrc.js
.prettierignore
vitest.workspace.ts
.github/workflows/gui*
files_ignore: |
app/ide-desktop/**
app/gui/scripts/**
app/gui/.gitignore
.git-*
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.gui-changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
wasm-changed-files:
runs-on: ubuntu-latest
name: 🔍 WASM files changed
outputs:
all_changed_files: ${{ steps.wasm-changed-files.outputs.all_changed_files }}
any_changed: ${{ steps.wasm-changed-files.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get changed files
id: wasm-changed-files
uses: tj-actions/changed-files@v45
with:
files: |
.cargo/**
app/rust-ffi/**,
build/**,
lib/rust/**",
tools/language-server/logstat/**",
tools/language-server/wstest/**",
Cargo.lock,
Cargo.toml,
rust-toolchain.toml,
rustfmt.toml
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.wasm-changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
engine-changed-files:
runs-on: ubuntu-latest
name: 🔍 Engine files changed
outputs:
all_changed_files: ${{ steps.engine-changed-files.outputs.all_changed_files }}
any_changed: ${{ steps.engine-changed-files.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get changed files
id: engine-changed-files
uses: tj-actions/changed-files@v45
with:
files: |
distribution/**
engine/**
lib/**
project/**
std-bits/**
test/**
build.sbt
.cargo/**
Cargo.lock,
Cargo.toml,
rust-toolchain.toml,
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.engine-changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
gui-checks:
name: 🧰 GUI Checks
uses: ./.github/workflows/gui-checks.yml
needs: [gui-changed-files]
if: ${{ needs.gui-changed-files.outputs.any_changed == 'true' }}
secrets: inherit
wasm-checks:
name: 🧰 WASM Checks
uses: ./.github/workflows/gui-tests.yml
needs: [wasm-changed-files]
if: ${{ needs.wasm-changed-files.outputs.any_changed == 'true' }}
secrets: inherit
engine-checks:
name: 🧰 Engine Checks
uses: ./.github/workflows/scala-new.yml
needs: [engine-changed-files]
if: ${{ needs.engine-changed-files.outputs.any_changed == 'true' }}
secrets: inherit
gui-packaging:
name: 🧰 GUI Packaging
uses: ./.github/workflows/gui.yml
needs: [gui-changed-files, wasm-changed-files, engine-changed-files]
if: ${{ needs.gui-changed-files.outputs.any_changed == 'true' || needs.wasm-changed-files.outputs.any_changed == 'true' || needs.engine-changed-files.outputs.any_changed == 'true' }}
secrets: inherit
storybook:
name: 📚 Deploy Storybook
uses: ./.github/workflows/storybook.yml
needs: [gui-changed-files]
if: ${{ needs.gui-changed-files.outputs.any_changed == 'true' }}
secrets: inherit
# This job is used to report success if the needed jobs were successful.
# This is a workaround to make optional jobs required if they run
checks-report:
name: Checks Report
runs-on: ubuntu-latest
needs: [gui-checks, storybook, wasm-checks, engine-checks, gui-packaging]
if: always()
steps:
- name: Combined Checks Report
run: |
echo "GUI Checks: ${{ needs.gui-checks.result }}"
echo "Storybook: ${{ needs.storybook.result }}"
echo "WASM Checks: ${{ needs.wasm-checks.result }}"
echo "Engine Checks: ${{ needs.engine-checks.result }}"
echo "GUI Packaging: ${{ needs.gui-packaging.result }}"
declare -a checks
checks+=("${{ needs.gui-checks.result }}")
checks+=("${{ needs.storybook.result }}")
checks+=("${{ needs.wasm-checks.result }}")
checks+=("${{ needs.engine-checks.result }}")
checks+=("${{ needs.gui-packaging.result }}")
for result in "${checks[@]}"
do
if [[ "$result" == "failure" ]]
then
exit 1
fi
done
echo "Success!"