From ce445fa5e113cb5adb3b00e1f7270220e8c35db9 Mon Sep 17 00:00:00 2001 From: Tom Scott Date: Fri, 24 Feb 2023 17:01:49 -0500 Subject: [PATCH] add github actions --- .github/release.yml | 13 ++++++++ .github/workflows/ci.yml | 62 +++++++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 32 ++++++++++++++++++ .travis.yml | 24 -------------- 4 files changed, 107 insertions(+), 24 deletions(-) create mode 100644 .github/release.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish.yml delete mode 100644 .travis.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..5c8fd98 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,13 @@ +changelog: + exclude: + labels: [dependencies] + authors: [renovate-bot] + categories: + - title: Breaking Changes + labels: [breaking] + - title: New Features + labels: [enhancement] + - title: Bug Fixes + labels: [bug] + - title: Other Changes + labels: ["*"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0935bc6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +name: CI +on: + push: + branches-ignore: [master] + tags-ignore: [v*] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + test: + name: "test (ruby: ${{ matrix.ruby }}, redis.rb: ${{ matrix.redis }})" + runs-on: ubuntu-latest + continue-on-error: ${{ contains(matrix.ruby, 'head') }} + strategy: + fail-fast: false + matrix: + ruby: + - "2.7" + - "3.0" + - "3.1" + # - 'head' + - "jruby" + # - 'jruby-head' + - "truffleruby" + # - 'truffleruby-head' + redis: + - 4_0_x + - 4_1_x + - 4_x + env: + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/redis_${{ matrix.redis }}.gemfile + services: + redis: + image: redis + ports: + - 6379:6379 + distributed1: + image: redis + ports: + - 6380:6380 + distributed2: + image: redis + ports: + - 6381:6381 + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: bundle exec rake + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.1 + bundler-cache: true + - run: bundle exec rake lint diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7ff9882 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish +on: + push: + tags: [v*] +permissions: + contents: write +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.1" + bundler-cache: true + - run: | + mkdir -p ~/.gem + cat << EOF > ~/.gem/credentials + --- + :rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }} + EOF + + chmod 0600 ~/.gem/credentials + - run: bundle exec rake release + - uses: softprops/action-gh-release@v1 + with: + files: "*.gem" + generate_release_notes: true + prerelease: ${{ contains(github.ref, '.pre') }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0995adf..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: ruby -script: bundle exec rake -rvm: -- 2.3 -- 2.4 -- 2.5 -- 2.6 -- ruby-head -- jruby-head -matrix: - allow_failures: - - rvm: jruby-head - - rvm: ruby-head -gemfile: -- gemfiles/rack_cache_1.6.gemfile -- gemfiles/rack_cache_1.7.gemfile -deploy: - provider: rubygems - api_key: - secure: RYf0UGiV7fuEYq/va2JXhoXU9Q9xdcE3HgYF7LqIACY4tPnNNAPkkwDmHb7IGfVucJ/e+dcWrTSg5gYhtUzywoLSJhnOzb7SxoPvusggpqezqtwfl5oc1/51ldlnuzWKl63LM4k97mX+voqu3r7ZITJaenSys11nSMm1yz97RDI= - gem: redis-rack-cache - on: - tags: true - repo: redis-store/redis-rack-cache