Skip to content

Commit

Permalink
ci: introduce rubocop; add a quick early test for fast feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Jan 23, 2024
1 parent c6ca678 commit 420926e
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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}}
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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}}
Expand Down

0 comments on commit 420926e

Please sign in to comment.