From e9a3941e363a0d9c9b5c77e66a360a693fc62d15 Mon Sep 17 00:00:00 2001 From: Anders Chen Date: Mon, 27 Nov 2023 18:22:31 +0700 Subject: [PATCH] Add GHA workflow to run tests against several ruby versions --- .github/workflows/run-tests.yml | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/run-tests.yml diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..b52e57e --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,36 @@ +name: Run Tests +on: push + +jobs: + test: + strategy: + matrix: + ruby_version: ['2.7', '3.0', '3.1', '3.2'] + runs-on: ubuntu-22.04 + steps: + - name: Install NSQ + shell: bash + run: | + wget https://github.com/nsqio/nsq/releases/download/v1.2.1/nsq-1.2.1.linux-amd64.go1.16.6.tar.gz + tar xvzf nsq-1.2.1.linux-amd64.go1.16.6.tar.gz + echo "$GITHUB_WORKSPACE/nsq-1.2.1.linux-amd64.go1.16.6/bin" >> $GITHUB_PATH + + - name: Check NSQ is properly installed + shell: bash + run: | + set -euo pipefail + which nsqd + + - name: Check out Git repository + uses: actions/checkout@v4 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby_version }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + - name: Run tests + shell: bash + run: | + echo "path: $PATH" + bundle exec rspec spec