Merge pull request #923 from sanger/Y26-191-aliquot-sample-name #2728
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: Ruby Lint and Test | |
| on: | |
| - push | |
| - pull_request | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: sanger/.github/.github/actions/setup/checkout@master | |
| - name: Setup Ruby | |
| uses: sanger/.github/.github/actions/setup/ruby@master | |
| - name: Run lint | |
| run: bundle exec rubocop --display-style-guide --extra-details --parallel | |
| test: | |
| runs-on: ubuntu-latest | |
| env: | |
| DBHOST: 127.0.0.1 # If we use localhost, rails tries to use a socket | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| mysql-version: ["8.0", "8.4"] | |
| # Services | |
| # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idservices | |
| services: | |
| mysql: | |
| # Use the Mysql docker image https://hub.docker.com/_/mysql | |
| image: mysql:${{ matrix.mysql-version }} | |
| ports: | |
| - 3306:3306 # Default port mappings | |
| # Monitor the health of the container to mesaure when it is ready | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| env: | |
| MYSQL_ROOT_PASSWORD: "" # Set root PW to nothing | |
| MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
| steps: | |
| - name: Checkout Repository | |
| uses: sanger/.github/.github/actions/setup/checkout@master | |
| - name: Setup Ruby | |
| uses: sanger/.github/.github/actions/setup/ruby@master | |
| - name: Setup database | |
| run: bundle exec rake db:setup | |
| - name: Run rspec | |
| run: bundle exec rspec | |
| - name: Upload coverage reports to Codecov | |
| uses: sanger/.github/.github/actions/tests/codecov@master | |
| with: | |
| name: ${{ github.run_id }}_${{ github.job }}_${{ github.event_name }} | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: ruby,${{ github.event_name }} | |
| disable-search: true | |
| files: ${{ github.workspace }}/lcov.info |