diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e7a0a14 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +jobs: + rubocop: + name: Rubocop + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Ruby and install gems + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.4 + bundler-cache: true + - name: Run rubocop + run: bin/rubocop + + tests: + name: Tests + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby-version: + - 3.2 + - 3.3 + - 3.4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Ruby and install gems + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + - name: Run tests + run: bin/rails test diff --git a/test/jobs/action_push_native/notification_job_test.rb b/test/jobs/action_push_native/notification_job_test.rb index 32f751d..cbeaa02 100644 --- a/test/jobs/action_push_native/notification_job_test.rb +++ b/test/jobs/action_push_native/notification_job_test.rb @@ -36,7 +36,7 @@ class NotificationJobTest < ActiveSupport::TestCase test "Socket errors are retried" do device = action_push_native_devices(:pixel9) - Net::HTTP.any_instance.stubs(:request).raises(Socket::ResolutionError) + Net::HTTP.any_instance.stubs(:request).raises(SocketError) ActionPushNative::Service::Fcm.any_instance.stubs(:access_token).returns("fake_access_token") assert_enqueued_jobs 1, only: ActionPushNative::NotificationJob do