|
| 1 | +name: "[CI] Process Settings" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - release/* |
| 8 | + - "*-stable" |
| 9 | + pull_request: |
| 10 | + |
| 11 | +env: |
| 12 | + RUBY_VERSION: 3.3.4 |
| 13 | + |
| 14 | +jobs: |
| 15 | + test-report: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + services: |
| 19 | + postgres: |
| 20 | + image: postgres:14 |
| 21 | + ports: ["5432:5432"] |
| 22 | + options: >- |
| 23 | + --health-cmd pg_isready |
| 24 | + --health-interval 10s |
| 25 | + --health-timeout 5s |
| 26 | + --health-retries 5 |
| 27 | + env: |
| 28 | + POSTGRES_PASSWORD: postgres |
| 29 | + env: |
| 30 | + DATABASE_USERNAME: postgres |
| 31 | + DATABASE_PASSWORD: postgres |
| 32 | + DATABASE_HOST: localhost |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v4 |
| 35 | + with: |
| 36 | + fetch-depth: 1 |
| 37 | + |
| 38 | + - uses: ruby/setup-ruby@master |
| 39 | + with: |
| 40 | + ruby-version: ${{ env.RUBY_VERSION }} |
| 41 | + |
| 42 | + # The test app is generated with Decidim's AppGenerator, which installs the |
| 43 | + # npm/shakapacker dependencies, so Node is required before `rake test_app`. |
| 44 | + - uses: actions/setup-node@v4 |
| 45 | + with: |
| 46 | + node-version-file: decidim-process_settings/.nvmrc |
| 47 | + |
| 48 | + - name: Recover Ruby dependency cache |
| 49 | + uses: actions/cache@v4 |
| 50 | + with: |
| 51 | + path: ./vendor/bundle |
| 52 | + key: ${{ runner.OS }}-rubydeps-${{ hashFiles('Gemfile.lock') }} |
| 53 | + restore-keys: | |
| 54 | + ${{ runner.OS }}-rubydeps-${{ env.cache-name }}- |
| 55 | + ${{ runner.OS }}-rubydeps- |
| 56 | + ${{ runner.OS }}- |
| 57 | +
|
| 58 | + - name: Set bundle local config vendor/bundle path |
| 59 | + run: bundle config set --local path 'vendor/bundle' |
| 60 | + |
| 61 | + - name: Install Ruby deps |
| 62 | + uses: nick-invision/retry@v3 |
| 63 | + with: |
| 64 | + timeout_minutes: 10 |
| 65 | + max_attempts: 3 |
| 66 | + retry_on: error |
| 67 | + command: | |
| 68 | + cd decidim-process_settings |
| 69 | + bundle install --jobs 4 --retry 3 |
| 70 | +
|
| 71 | + - name: Generate process_settings test_app |
| 72 | + run: | |
| 73 | + cd decidim-process_settings |
| 74 | + bundle exec rake test_app |
| 75 | +
|
| 76 | + - name: Precompile assets |
| 77 | + working-directory: ./decidim-process_settings/spec/decidim_dummy_app |
| 78 | + run: RAILS_ENV=test bundle exec rails shakapacker:compile |
| 79 | + |
| 80 | + - name: Run RSpec |
| 81 | + uses: nick-invision/retry@v3 |
| 82 | + with: |
| 83 | + timeout_minutes: 10 |
| 84 | + max_attempts: 3 |
| 85 | + retry_on: error |
| 86 | + command: | |
| 87 | + cd decidim-process_settings |
| 88 | + CI=1 DISABLE_SPRING=1 RAILS_ENV=test bundle exec rspec --backtrace |
0 commit comments