From fe598bec1b0cb02eee1b54535ad302600cd7be84 Mon Sep 17 00:00:00 2001 From: Aleksander Gosk Date: Mon, 22 Jul 2024 10:58:02 +0200 Subject: [PATCH] MANGO-1216 feat(GHA/CI/CD): move to GHA One of the strategic goals is to move away from CircleCI into GitHub Actions. See: https://github.com/blinkist/backend-starter-kit/blob/main/docs/adrs/010_github_actions.md --- .circleci/config.yml | 26 -------------------------- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 26 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 06af052..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: 2 -jobs: - build: - working_directory: ~/blinkist/blinkist-config - parallelism: 1 - docker: - - image: cimg/ruby:2.7.3-browsers - steps: - - checkout - - restore_cache: - keys: - - gem-cache-{{ checksum "Gemfile.lock" }} - - gem-cache- - - run: - name: Bundle Install - command: bundle install --jobs=4 --retry=3 --path=vendor/bundle - - save_cache: - key: gem-cache-{{ checksum "Gemfile.lock" }} - paths: - - vendor/bundle - - run: - name: RSpec - command: bundle exec rspec --format progress spec - environment: - RAILS_ENV: test - RACK_ENV: test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2a7c540 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI + +on: [ push ] + +jobs: + build: + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_DB: myapp_test + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7.3 + bundler-cache: true + + - name: Bundle Install + run: bundle install --jobs=4 --retry=3 --path=vendor/bundle + + - name: Run RSpec + env: + RAILS_ENV: test + RACK_ENV: test + run: bundle exec rspec --format progress spec