Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Update tests.yml

Damian Legawiec78a4562fc24b
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 7e8e8d3bb0..bc1d2434dc 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -40,20 +40,21 @@ jobs:
uses: actions/cache@v4
with:
path: vendor/bundle
- key: gems-${{ runner.os }}-ruby4.0-postgres-${{ hashFiles('Gemfile', '*.gemspec', 'common_spree_dependencies.rb', '*/*.gemspec') }}
+ key: gems-${{ runner.os }}-ruby4.0-postgres-${{ hashFiles('backend/Gemfile.lock') }}
restore-keys: |
gems-${{ runner.os }}-ruby4.0-postgres-
- name: Install root dependencies
+ working-directory: backend/engines
run: |
- bundle config set --local path vendor/bundle
+ bundle config set --local path ${{ github.workspace }}/vendor/bundle
bundle install
- name: Install all project dependencies
run: |
for project in core api admin emails sample; do
echo "--- Installing gems for $project ---"
- cd $project
+ cd backend/engines/$project
bundle config set --local path ${{ github.workspace }}/vendor/bundle
bundle install
cd ${{ github.workspace }}
@@ -78,20 +79,21 @@ jobs:
uses: actions/cache@v4
with:
path: vendor/bundle
- key: gems-${{ runner.os }}-ruby4.0-mysql-${{ hashFiles('Gemfile', '*.gemspec', 'common_spree_dependencies.rb', '*/*.gemspec') }}
+ key: gems-${{ runner.os }}-ruby4.0-mysql-${{ hashFiles('backend/Gemfile.lock') }}
restore-keys: |
gems-${{ runner.os }}-ruby4.0-mysql-
- name: Install root dependencies
+ working-directory: backend/engines
run: |
- bundle config set --local path vendor/bundle
+ bundle config set --local path ${{ github.workspace }}/vendor/bundle
bundle install
- name: Install all project dependencies
run: |
for project in core api admin emails sample; do
echo "--- Installing gems for $project ---"
- cd $project
+ cd backend/engines/$project
bundle config set --local path ${{ github.workspace }}/vendor/bundle
bundle install
cd ${{ github.workspace }}
@@ -154,7 +156,7 @@ jobs:
uses: actions/cache@v4
with:
path: vendor/bundle
- key: gems-${{ runner.os }}-ruby4.0-postgres-${{ hashFiles('Gemfile', '*.gemspec', 'common_spree_dependencies.rb', '*/*.gemspec') }}
+ key: gems-${{ runner.os }}-ruby4.0-postgres-${{ hashFiles('backend/Gemfile.lock') }}
restore-keys: |
gems-${{ runner.os }}-ruby4.0-postgres-
@@ -163,24 +165,25 @@ jobs:
- name: Install dependencies
run: |
- bundle config set --local path vendor/bundle
+ cd backend/engines
+ bundle config set --local path ${{ github.workspace }}/vendor/bundle
bundle install
cd ${{ matrix.project }}
bundle config set --local path ${{ github.workspace }}/vendor/bundle
bundle install
- name: Setup test app
- working-directory: ${{ matrix.project }}
+ working-directory: backend/engines/${{ matrix.project }}
run: |
if [[ "${{ matrix.project }}" == "core" || "${{ matrix.project }}" == "api" ]]; then
- bundle exec --gemfile=${{ github.workspace }}/Gemfile rake test_app
+ bundle exec --gemfile=${{ github.workspace }}/backend/engines/Gemfile rake test_app
else
bundle exec rake test_app
fi
- name: Select shard specs
id: specs
- working-directory: ${{ matrix.project }}
+ working-directory: backend/engines/${{ matrix.project }}
run: |
all_specs=($(find spec -name '*_spec.rb' | sort))
total=${#all_specs[@]}
@@ -195,7 +198,7 @@ jobs:
echo "files=${shard_specs[*]}" >> "$GITHUB_OUTPUT"
- name: Run tests
- working-directory: ${{ matrix.project }}
+ working-directory: backend/engines/${{ matrix.project }}
run: |
mkdir -p ${{ github.workspace }}/tmp/test-results/rspec
bundle exec rspec \
@@ -279,7 +282,7 @@ jobs:
uses: actions/cache@v4
with:
path: vendor/bundle
- key: gems-${{ runner.os }}-ruby4.0-mysql-${{ hashFiles('Gemfile', '*.gemspec', 'common_spree_dependencies.rb', '*/*.gemspec') }}
+ key: gems-${{ runner.os }}-ruby4.0-mysql-${{ hashFiles('backend/Gemfile.lock') }}
restore-keys: |
gems-${{ runner.os }}-ruby4.0-mysql-
@@ -288,24 +291,25 @@ jobs:
- name: Install dependencies
run: |
- bundle config set --local path vendor/bundle
+ cd backend/engines
+ bundle config set --local path ${{ github.workspace }}/vendor/bundle
bundle install
cd ${{ matrix.project }}
bundle config set --local path ${{ github.workspace }}/vendor/bundle
bundle install
- name: Setup test app
- working-directory: ${{ matrix.project }}
+ working-directory: backend/engines/${{ matrix.project }}
run: |
if [[ "${{ matrix.project }}" == "core" || "${{ matrix.project }}" == "api" ]]; then
- bundle exec --gemfile=${{ github.workspace }}/Gemfile rake test_app
+ bundle exec --gemfile=${{ github.workspace }}/backend/engines/Gemfile rake test_app
else
bundle exec rake test_app
fi
- name: Select shard specs
id: specs
- working-directory: ${{ matrix.project }}
+ working-directory: backend/engines/${{ matrix.project }}
run: |
all_specs=($(find spec -name '*_spec.rb' | sort))
total=${#all_specs[@]}
@@ -320,7 +324,7 @@ jobs:
echo "files=${shard_specs[*]}" >> "$GITHUB_OUTPUT"
- name: Run tests
- working-directory: ${{ matrix.project }}
+ working-directory: backend/engines/${{ matrix.project }}
run: |
mkdir -p ${{ github.workspace }}/tmp/test-results/rspec
bundle exec rspec \
@@ -367,22 +371,24 @@ jobs:
uses: actions/cache@v4
with:
path: vendor/bundle
- key: gems-${{ runner.os }}-ruby4.0-postgres-${{ hashFiles('Gemfile', '*.gemspec', 'common_spree_dependencies.rb', '*/*.gemspec') }}
+ key: gems-${{ runner.os }}-ruby4.0-postgres-${{ hashFiles('backend/Gemfile.lock') }}
restore-keys: |
gems-${{ runner.os }}-ruby4.0-postgres-
- name: Install dependencies
+ working-directory: backend/engines
run: |
- bundle config set --local path vendor/bundle
+ bundle config set --local path ${{ github.workspace }}/vendor/bundle
bundle install
- name: Run Brakeman
- run: bin/brakeman.sh
+ working-directory: backend
+ run: bin/brakeman
- name: Upload Brakeman reports
if: always()
uses: actions/upload-artifact@v4
with:
name: brakeman-reports
- path: brakeman-*.*
+ path: backend/brakeman-*.*
if-no-files-found: ignore