Skip to content

Commit

Permalink
Merge pull request #5583 from solidusio/elia/separate-subframeworks-c…
Browse files Browse the repository at this point in the history
…i-runs

Separate subframeworks CI runs
  • Loading branch information
elia authored Jan 5, 2024
2 parents 2b28f94 + 0b9ca18 commit be5fea9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
19 changes: 17 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,23 @@ commands:
test:
steps:
- run:
name: Run Tests
command: ./bin/build-ci
name: "Run Admin Tests"
command: ./bin/build-ci admin
- run:
name: "Run Api Tests"
command: ./bin/build-ci api
- run:
name: "Run Backend Tests"
command: ./bin/build-ci backend
- run:
name: "Run Backend JS Tests"
command: ./bin/build-ci "backend JS"
- run:
name: "Run Core Tests"
command: ./bin/build-ci core
- run:
name: "Run Sample Tests"
command: ./bin/build-ci sample

- store_artifacts:
path: /tmp/test-artifacts
Expand Down
15 changes: 11 additions & 4 deletions bin/build-ci
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,22 @@ class Project
end
end

if ARGV.first # Run a single project
projects = Project.all.select { _1.name == ARGV.first }
elsif ENV['CIRCLE_NODE_INDEX'] # Run projects on a CI node

if ENV['CIRCLE_NODE_INDEX'] # Run projects on a CI node
projects = Project.weighted_projects(
node_total: Integer(ENV.fetch('CIRCLE_NODE_TOTAL', 1)),
node_index: Integer(ENV.fetch('CIRCLE_NODE_INDEX', 0)),
)
else # Run all projects
else
projects = Project.all
end

# Run a single project if requested
projects.select! { _1.title == ARGV.first } if ARGV.first

if projects.empty?
warn("No projects to run")
exit 0
end

exit Project.run(projects)

0 comments on commit be5fea9

Please sign in to comment.