|
| 1 | +name: Test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + pull_request: |
| 7 | + branches: [ master ] |
| 8 | + schedule: |
| 9 | + - cron: '02 4 * * *' |
| 10 | + |
| 11 | +jobs: |
| 12 | + static: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v2 |
| 16 | + - uses: ruby/setup-ruby@v1 |
| 17 | + with: |
| 18 | + ruby-version: 2.7 |
| 19 | + bundler-cache: true |
| 20 | + - run : bundle exec rake rubocop |
| 21 | + test: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + services: |
| 24 | + postgres: |
| 25 | + image: postgres |
| 26 | + env: |
| 27 | + POSTGRES_PASSWORD: password |
| 28 | + options: >- |
| 29 | + --health-cmd pg_isready |
| 30 | + --health-interval 10s |
| 31 | + --health-timeout 5s |
| 32 | + --health-retries 5 |
| 33 | + ports: |
| 34 | + # Maps tcp port 5432 on service container to the host |
| 35 | + - 5432:5432 |
| 36 | + env: |
| 37 | + BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }} |
| 38 | + RUN_GENERATORS: ${{ matrix.run_generators }} |
| 39 | + PGPASSWORD: password |
| 40 | + DATABASE_ADAPTER: ${{ matrix.database_adapter }} |
| 41 | + DATABASE_NAME: ${{ matrix.database_name }} |
| 42 | + DATABASE_PASSWORD: ${{ matrix.database_password }} |
| 43 | + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
| 44 | + strategy: |
| 45 | + matrix: |
| 46 | + rvm: ["2.7"] |
| 47 | + gemfile: ["Gemfile"] |
| 48 | + run_generators: ["false"] |
| 49 | + database_adapter: ['sqlite3'] |
| 50 | + database_name: [":memory:"] |
| 51 | + database_password: ["password"] |
| 52 | + include: |
| 53 | + - rvm: ruby-head |
| 54 | + gemfile: gemfiles/rails_master.gemfile |
| 55 | + run_generators: "false" |
| 56 | + database_adapter: 'sqlite3' |
| 57 | + database_name: ":memory:" |
| 58 | + - rvm: 2.3.8 |
| 59 | + gemfile: gemfiles/rails_3.2.gemfile |
| 60 | + run_generators: "false" |
| 61 | + database_adapter: 'sqlite3' |
| 62 | + database_name: ":memory:" |
| 63 | + - rvm: 2.3.8 |
| 64 | + gemfile: gemfiles/rails_4.2.gemfile |
| 65 | + run_generators: "false" |
| 66 | + database_adapter: 'sqlite3' |
| 67 | + database_name: ":memory:" |
| 68 | + - rvm: 2.7 |
| 69 | + gemfile: gemfiles/rails_5.2.gemfile |
| 70 | + run_generators: "false" |
| 71 | + database_adapter: 'sqlite3' |
| 72 | + database_name: ":memory:" |
| 73 | + - rvm: 2.7 |
| 74 | + gemfile: gemfiles/rails_6.0.gemfile |
| 75 | + run_generators: "false" |
| 76 | + database_adapter: 'sqlite3' |
| 77 | + database_name: ":memory:" |
| 78 | + - rvm: 2.7 |
| 79 | + gemfile: gemfiles/rails_5.2.gemfile |
| 80 | + run_generators: "false" |
| 81 | + database_adapter: 'sqlite3' |
| 82 | + database_name: ":memory:" |
| 83 | + - rvm: 2.7 |
| 84 | + gemfile: gemfiles/rails_6.0.gemfile |
| 85 | + run_generators: "true" |
| 86 | + database_adapter: 'sqlite3' |
| 87 | + database_name: ":memory:" |
| 88 | + - rvm: 2.7 |
| 89 | + gemfile: gemfiles/rails_6.0.gemfile |
| 90 | + database_adapter: 'postgresql' |
| 91 | + database_name: 'ci_test' |
| 92 | + database_password: "password" |
| 93 | + run_generators: "false" |
| 94 | + - rvm: 2.7 |
| 95 | + gemfile: gemfiles/rails_7.0.gemfile |
| 96 | + run_generators: "true" |
| 97 | + database_adapter: 'sqlite3' |
| 98 | + database_name: ":memory:" |
| 99 | + steps: |
| 100 | + - uses: actions/checkout@v2 |
| 101 | + - uses: ruby/setup-ruby@v1 |
| 102 | + with: |
| 103 | + ruby-version: ${{ matrix.rvm }} |
| 104 | + bundler-cache: true |
| 105 | + - run: psql -c 'create database ci_test;' -U postgres -h localhost |
| 106 | + - run: bundle exec rake |
| 107 | + documentation: |
| 108 | + runs-on: ubuntu-latest |
| 109 | + needs: ['test', 'static'] |
| 110 | + if: github.ref == 'refs/heads/master' |
| 111 | + steps: |
| 112 | + - uses: actions/checkout@v2 |
| 113 | + - uses: ruby/setup-ruby@v1 |
| 114 | + with: |
| 115 | + ruby-version: 2.7 |
| 116 | + bundler-cache: true |
| 117 | + - run: 'bundle exec yard doc --private' |
| 118 | + - uses: JamesIves/github-pages-deploy-action@4.1.7 |
| 119 | + with: |
| 120 | + branch: gh-pages |
| 121 | + folder: doc |
| 122 | + |
0 commit comments