Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run workflows depending on changed files #11723

Merged
merged 43 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
4680c7d
update: CI PR workflows
4e6 Nov 29, 2024
234b87b
fix: workflow call
4e6 Nov 29, 2024
6c28719
fix: report-success
4e6 Nov 29, 2024
2ab036d
fix: wasm check permissions
4e6 Nov 29, 2024
ae6a57d
fix: concurrency settings
4e6 Nov 29, 2024
a782375
update: final report
4e6 Nov 29, 2024
7f3d4d1
update: single checks report
4e6 Nov 29, 2024
4a1d023
misc: cleanup
4e6 Nov 29, 2024
aa3d4f5
misc: wasm dependency
4e6 Dec 1, 2024
b8d6164
update: print files changed
4e6 Dec 2, 2024
2391dde
update: always run on develop
4e6 Dec 2, 2024
8f0c76a
update: concurrency
4e6 Dec 2, 2024
b026e2c
update: changed files
4e6 Dec 2, 2024
deb8ca0
update: macos continue on error
4e6 Dec 2, 2024
db1e358
DEBUG: continue-on-error
4e6 Dec 2, 2024
cf20381
DEBUG: speedup continue-on-error
4e6 Dec 2, 2024
8c5819c
DEBUG: continue-on-error 1
4e6 Dec 2, 2024
c627fa6
DEBUG: revert continue-on-error
4e6 Dec 2, 2024
66e7a49
update: gui macos continue on error
4e6 Dec 2, 2024
fc09e7e
refactor: rename pull request workflow
4e6 Dec 2, 2024
8978508
refactor: rename workflows
4e6 Dec 2, 2024
9029a81
update: pull request workflow
4e6 Dec 2, 2024
8410bb1
misc: cleanup debug workflow
4e6 Dec 2, 2024
91158b3
update: finishing touches
4e6 Dec 2, 2024
4868af5
misc: naming
4e6 Dec 2, 2024
6bde1f7
feat: optional targets
4e6 Dec 3, 2024
578fed7
misc: naming
4e6 Dec 3, 2024
d04f8c3
update: reuse gui-changed-files
4e6 Dec 5, 2024
0bbc3d5
update: speedup
4e6 Dec 5, 2024
bdfdd53
DEBUG: git-changed-files unnamed
4e6 Dec 5, 2024
41f9b42
update: reuse changed files
4e6 Dec 5, 2024
443d786
update: split pull requests
4e6 Dec 5, 2024
834e787
fix: shell script
4e6 Dec 5, 2024
fabf077
misc: cleanup
4e6 Dec 5, 2024
a492747
misc: naming
4e6 Dec 5, 2024
f5e2864
misc: cleanup shader-tools workflow
4e6 Dec 5, 2024
472d38d
update: changed files patterns
4e6 Dec 5, 2024
ca68f1f
Merge branch 'develop' into wip/db/11579-run-ci-backend-when-sources-…
4e6 Dec 6, 2024
27f72b7
misc: optimize naming
4e6 Dec 6, 2024
cb8a674
Merge branch 'develop' into wip/db/11579-run-ci-backend-when-sources-…
4e6 Dec 17, 2024
14c7ac5
fix: after merge
4e6 Dec 17, 2024
4225fbb
update: regen workflows
4e6 Dec 17, 2024
eb4071b
update: check prettier outcome
4e6 Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/gui-checks.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is not auto-generated. Feel free to edit it.

name: GUI Checks
on: workflow_call

Expand Down
143 changes: 122 additions & 21 deletions .github/workflows/gui-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is not auto-generated. Feel free to edit it.

name: ✨ GUI Pull Request
name: ✨ Pull Request

on:
push:
Expand All @@ -20,19 +20,19 @@ permissions:
checks: write

jobs:
changed-files:
gui-changed-files:
runs-on: ubuntu-latest
name: 🔍 GUI files changed
outputs:
all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
any_changed: ${{ steps.changed-files.outputs.any_changed }}
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: changed-files
uses: tj-actions/changed-files@v44
id: gui-changed-files
uses: tj-actions/changed-files@v45
with:
files: |
app/**
Expand All @@ -49,44 +49,145 @@ jobs:
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.changed-files.outputs.all_changed_files }}
ALL_CHANGED_FILES: ${{ steps.wasm-changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done

checks:
name: 🧰 Checks
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: [changed-files]
if: ${{ needs.changed-files.outputs.any_changed == 'true' }}
needs: [gui-changed-files]
if: needs.gui-changed-files.outputs.any_changed == 'true'
secrets: inherit

storybook:
name: 📚 Deploy Storybook
uses: ./.github/workflows/storybook.yml
needs: [changed-files]
if: ${{ needs.changed-files.outputs.any_changed == 'true' }}
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, engine-changed-files]
if: needs.gui-changed-files.outputs.any_changed == 'true' || needs.engine-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
report-success:
name: GUI Checks Success or Skipped
checks-report:
name: Checks Report
runs-on: ubuntu-latest
needs: [checks, storybook]
needs: [gui-checks, storybook, wasm-checks, engine-checks, gui-packaging]
if: always()
steps:
- name: Report success
- name: Combined Checks Report
run: |
echo "Checks: ${{ needs.checks.result }}"
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 }}"

if [[ "${{ needs.checks.result }}" == "failure" || "${{ needs.storybook.result }}" == "failure" ]]; then
exit 1
fi
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!"
19 changes: 2 additions & 17 deletions .github/workflows/gui-tests.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
# This file is auto-generated. Do not edit it manually!
# Edit the enso_build::ci_gen module instead and run `cargo run --package enso-build-ci-gen`.

name: GUI Check
name: WASM Checks
on:
push:
branches:
- develop
pull_request: {}
workflow_dispatch:
inputs:
clean_build_required:
description: Clean before and after the run.
required: false
type: boolean
default: false
workflow_call: {}
jobs:
enso-build-ci-gen-job-cancel-workflow-linux-amd64:
name: Cancel Previous Runs
if: github.ref != 'refs/heads/develop'
runs-on:
- ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
permissions:
actions: write
enso-build-ci-gen-job-lint-linux-amd64:
name: Lint (linux, amd64)
runs-on:
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/gui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@

name: GUI Packaging
on:
push:
branches:
- develop
pull_request: {}
workflow_dispatch:
inputs:
clean_build_required:
description: Clean before and after the run.
required: false
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
workflow_call: {}
jobs:
enso-build-ci-gen-job-build-backend-linux-amd64:
name: Build Backend (linux, amd64)
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/scala-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@

name: Engine CI
on:
push:
branches:
- develop
pull_request: {}
workflow_dispatch:
inputs:
clean_build_required:
description: Clean before and after the run.
required: false
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
workflow_call: {}
jobs:
enso-build-ci-gen-job-ci-check-backend-graal-vm-ce-linux-amd64:
name: Engine (GraalVM CE) (linux, amd64)
Expand Down
34 changes: 14 additions & 20 deletions build/build/src/ci_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,12 +651,12 @@ pub fn typical_check_triggers() -> Event {
}

pub fn gui() -> Result<Workflow> {
let mut workflow = Workflow {
name: "GUI Packaging".into(),
on: typical_check_triggers(),
concurrency: Some(concurrency()),
let on = Event {
workflow_dispatch: Some(manual_workflow_dispatch()),
workflow_call: Some(default()),
..default()
};
let mut workflow = Workflow { name: "GUI Packaging".into(), on, ..default() };

for target in PR_CHECKED_TARGETS {
let project_manager_job = workflow.add(target, job::BuildBackend);
Expand All @@ -669,31 +669,25 @@ pub fn gui() -> Result<Workflow> {
}

pub fn gui_tests() -> Result<Workflow> {
let on = typical_check_triggers();
let mut workflow = Workflow { name: "GUI Check".into(), on, ..default() };
workflow.add(PRIMARY_TARGET, job::CancelWorkflow);
let on = Event {
workflow_dispatch: Some(manual_workflow_dispatch()),
workflow_call: Some(default()),
..default()
};
let mut workflow = Workflow { name: "WASM Checks".into(), on, ..default() };
workflow.add(PRIMARY_TARGET, job::Lint);
workflow.add(PRIMARY_TARGET, job::WasmTest);
workflow.add(PRIMARY_TARGET, job::NativeTest);
Ok(workflow)
}

fn concurrency() -> Concurrency {
let github_workflow = wrap_expression("github.workflow");
let github_ref = wrap_expression("github.ref");
Concurrency::Map {
group: format!("{github_workflow}-{github_ref}"),
cancel_in_progress: wrap_expression(not_default_branch()),
}
}

pub fn backend() -> Result<Workflow> {
let mut workflow = Workflow {
name: "Engine CI".into(),
on: typical_check_triggers(),
concurrency: Some(concurrency()),
let on = Event {
workflow_dispatch: Some(manual_workflow_dispatch()),
workflow_call: Some(default()),
..default()
};
let mut workflow = Workflow { name: "Engine CI".into(), on, ..default() };
workflow.add(PRIMARY_TARGET, job::VerifyLicensePackages);
for target in PR_CHECKED_TARGETS {
add_backend_checks(&mut workflow, target, graalvm::Edition::Community);
Expand Down
Loading