From a384fe6ebc7d9ef35689ac977415ba39681e7390 Mon Sep 17 00:00:00 2001 From: Oleh Fedorenko Date: Thu, 19 Oct 2023 13:50:47 +0000 Subject: [PATCH] Fixes #36849 - Set up Foreman GA with Ruby 3.0 --- .github/workflows/foreman.yml | 60 +++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/foreman.yml diff --git a/.github/workflows/foreman.yml b/.github/workflows/foreman.yml new file mode 100644 index 000000000000..b332b3d146ab --- /dev/null +++ b/.github/workflows/foreman.yml @@ -0,0 +1,60 @@ +--- +name: Foreman (non-blocking) + +on: + - pull_request + +env: + RAILS_ENV: test + DATABASE_URL: postgresql://postgres:password@localhost/test + DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: true + BUNDLE_WITHOUT: "console:development:journald" + +jobs: + test: + name: "Foreman develop with Ruby ${{ matrix.ruby }} and Node ${{ matrix.node }}" + runs-on: ubuntu-latest + services: + postgres: + image: 'postgres:12' + ports: ['5432:5432'] + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + env: + POSTGRES_PASSWORD: password + strategy: + fail-fast: false + matrix: + ruby: + - "2.7" + - "3.0" + node: + - "12" + steps: + - run: sudo apt-get update + - run: sudo apt-get install build-essential libcurl4-openssl-dev zlib1g-dev libpq-dev libvirt-dev + - name: "Check out Foreman develop" + uses: actions/checkout@v4 + - name: "Set up Ruby ${{ matrix.ruby }}" + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Archive Gemfile.lock + uses: actions/upload-artifact@v3 + with: + name: Gemfile.lock + path: Gemfile.lock + - name: "Set up Node ${{ matrix.node }}" + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + - name: Prepare test env + run: | + bundle exec rake db:create + bundle exec rake db:migrate + - name: Run unit tests + run: bundle exec rake test:units + - name: Run functional tests + run: bundle exec rake test:functionals + - name: Run graphql tests + run: bundle exec rake test:graphql