on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Clone govuk-content-schemas
        uses: actions/checkout@v2
        with:
          repository: alphagov/govuk-content-schemas
          ref: deployed-to-production
          path: tmp/govuk-content-schemas
      - uses: ruby/setup-ruby@v1
      - uses: actions/cache@v1
        with:
          path: tmp/bundle
          key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gems-

      - run: |
          bundle config path tmp/bundle
          bundle install --jobs 4 --retry 3

      - run: bundle exec rubocop
      - run: bundle exec rake assets:precompile
      - run: bundle exec rake
        env:
          GOVUK_CONTENT_SCHEMAS_PATH: tmp/govuk-content-schemas

Use GitHub Actions for CI
Use GitHub Actions for CI

This will enable us to run CI on this fork without configuring Jenkins.

I'm leaving the JenkinsFile at the moment because we still need it to kick
off deploys when we merge back in to the "upstream" fork

Copied from [collections](https://github.com/alphagov/collections-private/blob/master/.github/workflows/tests.yml)
which works fine.
