diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index ba26bc4..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,59 +0,0 @@ -version: 2.1 - -references: - bundle_install: &bundle_install - run: - name: Bundle - command: | - gem install bundler --no-document && \ - bundle config set no-cache 'true' && \ - bundle config set jobs '4' && \ - bundle config set retry '3' && \ - bundle install - - cache_bundle: &cache_bundle - save_cache: - key: bundle-<< parameters.ruby_version >>-{{ checksum "que.gemspec" }}-{{ checksum "Gemfile" }} - paths: - - vendor/bundle - - restore_bundle: &restore_bundle - restore_cache: - key: bundle-<< parameters.ruby_version >>-{{ checksum "que.gemspec" }}-{{ checksum "Gemfile" }} - -jobs: - rspec: - working_directory: ~/que - parameters: - ruby_version: - type: string - docker: - - image: cimg/ruby:<< parameters.ruby_version >> - environment: - PGDATABASE: que-test - PGUSER: ubuntu - PGPASSWORD: password - PGHOST: localhost - - image: postgres:11.2 - environment: - POSTGRES_DB: que-test - POSTGRES_USER: ubuntu - POSTGRES_PASSWORD: password - steps: - - add_ssh_keys - - checkout - - *restore_bundle - - *bundle_install - - *cache_bundle - - run: - name: Run specs - command: bundle exec rspec - -workflows: - version: 2 - tests: - jobs: - - rspec: - matrix: - parameters: - ruby_version: ["2.6", "2.7", "3.0"] diff --git a/.github/workflows/specs.yml b/.github/workflows/specs.yml new file mode 100644 index 0000000..6383367 --- /dev/null +++ b/.github/workflows/specs.yml @@ -0,0 +1,58 @@ +name: Run Specs + +on: + push: +permissions: + contents: read + # We need write access to the id-token to use workload identity federation + id-token: write + packages: read + # Needed for getting PR labels + pull-requests: read + + +env: + PGDATABASE: que-test + PGUSER: ubuntu + PGPASSWORD: password + PGHOST: localhost + +jobs: + rspec: + runs-on: ubuntu-latest + strategy: + matrix: + ruby_version: ["2.6", "2.7", "3.0"] + + services: + postgres: + image: postgres:11.2 + env: + POSTGRES_DB: que-test + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: password + POSTGRES_HOST_AUTH_METHOD: trust + ports: + - 5432:5432 + + steps: + - name: Check Out Code + uses: actions/checkout@v2 + + - name: Cache Bundle + uses: actions/cache@v2 + with: + path: vendor/bundle + key: bundle-${{ matrix.ruby_version }}-${{ hashFiles('que.gemspec', 'Gemfile') }} + + - name: Bundle Install + run: | + gem install bundler --no-document + bundle config set no-cache 'true' + bundle config set jobs '4' + bundle config set retry '3' + bundle install + + - name: Run Specs + run: | + bundle exec rspec \ No newline at end of file