From 420926e5690e85022735b45c2acaa483acc56504 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Tue, 23 Jan 2024 15:32:19 -0500 Subject: [PATCH] ci: introduce rubocop; add a quick early test for fast feedback --- .github/workflows/ci.yml | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5948f7e6..842554be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,30 @@ jobs: # # basic tests # + rubocop: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.3" + bundler-cache: true + - run: bundle exec rake rubocop + + basic: + needs: ["rubocop"] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby-pkgs@v1 + with: + ruby-version: "3.3" + bundler-cache: true + apt-get: libsqlite3-dev + + sqlite3: + needs: ["basic"] strategy: fail-fast: false matrix: @@ -122,8 +145,12 @@ jobs: - run: bundle exec rake compile - run: bundle exec rake test:valgrind - rcd_setup: - needs: ["sqlite3"] + # + # native gem tests + # + native_setup: + name: "Setup for native gem tests" + needs: ["basic"] runs-on: ubuntu-latest outputs: rcd_image_version: ${{steps.rcd_image_version.outputs.rcd_image_version}} @@ -142,7 +169,7 @@ jobs: run: bundle exec ruby -e 'require "rake_compiler_dock"; puts "rcd_image_version=#{RakeCompilerDock::IMAGE_VERSION}"' >> $GITHUB_OUTPUT cruby-package: - needs: ["rcd_setup"] + needs: ["native_setup"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -251,7 +278,7 @@ jobs: ruby -rsqlite3 -e 'puts SQLite3::SQLITE_LOADED_VERSION' cruby-native-package: - needs: ["rcd_setup"] + needs: ["native_setup"] strategy: fail-fast: false matrix: @@ -272,7 +299,7 @@ jobs: path: ports/archives key: ports-archives-tarball-${{hashFiles('ext/sqlite3/extconf.rb','dependencies.yml')}} - env: - DOCKER_IMAGE: "ghcr.io/rake-compiler/rake-compiler-dock-image:${{needs.rcd_setup.outputs.rcd_image_version}}-mri-${{matrix.plat}}" + DOCKER_IMAGE: "ghcr.io/rake-compiler/rake-compiler-dock-image:${{needs.native_setup.outputs.rcd_image_version}}-mri-${{matrix.plat}}" run: | docker run --rm -v "$(pwd):/sqlite3" -w /sqlite3 ${DOCKER_IMAGE} \ ./bin/test-gem-build gems ${{matrix.plat}}