From 53c28e088efd7d97ade5877389202740f64b27d1 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Wed, 11 Sep 2024 13:47:17 +0530 Subject: [PATCH] unit tests with expeditor for linux Signed-off-by: Ashique Saidalavi --- .expeditor/run_linux_tests.sh | 16 ++++++++++++ .expeditor/verify.pipeline.yml | 47 ++++++++++++++++++++++++++++++++++ .github/workflows/unit.yml | 40 ----------------------------- 3 files changed, 63 insertions(+), 40 deletions(-) create mode 100644 .expeditor/run_linux_tests.sh delete mode 100644 .github/workflows/unit.yml diff --git a/.expeditor/run_linux_tests.sh b/.expeditor/run_linux_tests.sh new file mode 100644 index 000000000..7df193642 --- /dev/null +++ b/.expeditor/run_linux_tests.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# +# This script runs a passed in command, but first setups up the bundler caching on the repo + +set -ue + +export USER="root" +export LANG=C.UTF-8 LANGUAGE=C.UTF-8 + +echo "--- bundle install" + +bundle config --local path vendor/bundle +bundle install --jobs=7 --retry=3 + +echo "+++ bundle exec task" +bundle exec $@ diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index e69de29bb..11068bb59 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -0,0 +1,47 @@ +--- +expeditor: + cached_folders: + - vendor + defaults: + buildkite: + retry: + automatic: + limit: 1 + timeout_in_minutes: 30 + +steps: +- label: run-specs-ruby-3.1 + command: + - .expeditor/run_linux_tests.sh rake test + expeditor: + executor: + docker: + image: ruby:3.1 + +#- label: run-specs-windows-ruby-3.1 +# command: +# - powershell .expeditor/run_windows_tests.ps1 rspec +# expeditor: +# executor: +# docker: +# host_os: windows +# shell: ["powershell", "-Command"] +# image: rubydistros/windows-2019:3.1 + +- label: run-specs-ruby-3.3 + command: + - .expeditor/run_linux_tests.sh rspec + expeditor: + executor: + docker: + image: ruby:3.3 + +#- label: run-specs-windows-ruby-3.3 +# command: +# - powershell .expeditor/run_windows_tests.ps1 rspec +# expeditor: +# executor: +# docker: +# host_os: windows +# shell: ["powershell", "-Command"] +# image: rubydistros/windows-2019:3.3 diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml deleted file mode 100644 index f5f3a6d6b..000000000 --- a/.github/workflows/unit.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: unit_specs - -"on": - pull_request: - push: - branches: - - main - -concurrency: - group: unit-specs-${{ github.ref }} - cancel-in-progress: true - -jobs: - unit: - name: Unit Test with Ruby - runs-on: ubuntu-latest - strategy: - matrix: - ruby: ["3.1", "3.3"] - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Check for Gemfile - id: check - run: | - if [ -f Gemfile ]; then - echo "gemfile=true" >> $GITHUB_OUTPUT - else - echo "gemfile=false" >> $GITHUB_OUTPUT - fi - - name: Setup Ruby - if: steps.check.outputs.gemfile == 'true' - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - name: Rake Test - if: steps.check.outputs.gemfile == 'true' - run: bundle exec rake test