Fix Spree 5.4 compatiblity and CI builds (#14) #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| tests: | |
| name: Tests (${{ matrix.db }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| db: [postgres, mysql] | |
| include: | |
| - db: postgres | |
| database_url: postgres://postgres:password@localhost:5432/spree_test | |
| - db: mysql | |
| database_url: mysql2://root:password@127.0.0.1:3306/spree_test | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_DB: spree_test | |
| ports: ['5432:5432'] | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ROOT_PASSWORD: password | |
| MYSQL_DATABASE: spree_test | |
| ports: ['3306:3306'] | |
| options: >- | |
| --health-cmd "mysqladmin ping -h 127.0.0.1" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| DB: ${{ matrix.db }} | |
| DATABASE_URL: ${{ matrix.database_url }} | |
| RAILS_ENV: test | |
| CI: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3' | |
| bundler-cache: true | |
| - name: Install libvips | |
| run: sudo apt-get update && sudo apt-get install -y libvips | |
| - name: Create test app | |
| run: bundle exec rake test_app | |
| - name: Run specs | |
| run: bundle exec rspec --format progress --format RspecJunitFormatter --out tmp/test-results/rspec.xml | |
| brakeman: | |
| name: Brakeman | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3' | |
| bundler-cache: true | |
| - name: Run Brakeman | |
| run: bundle exec brakeman --exit-on-warn --exit-on-error |