Skip to content

ci

ci #2615

Workflow file for this run

name: ci
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
branches: [ main, master ]
push:
branches: [ main, master ]
schedule:
- cron: '0 1 * * *'
permissions:
contents: read
env:
BUNDLE_RETRY: 6
BUNDLE_JOBS: 4
jobs:
specs:
timeout-minutes: 15
runs-on: ubuntu-latest
needs: diffend
strategy:
fail-fast: false
matrix:
ruby:
- '3.4'
- '3.3'
- '3.2'
- '3.1'
include:
- ruby: '3.4'
coverage: 'true'
steps:
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
with:
fetch-depth: 0
- name: Install package dependencies
run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
- name: Start Kafka with Docker Compose
run: |
docker compose up -d || (sleep 5 && docker compose up -d)
- name: Set up Ruby
uses: ruby/setup-ruby@6c79f721fa26dd64559c2700086ac852c18e0756
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true
bundler: 'latest'
- name: Install latest bundler
run: |
gem install bundler --no-document
gem update --system --no-document
bundle config set without 'tools benchmarks docs'
- name: Bundle install
run: |
bundle config set without development
bundle install --jobs 4 --retry 3
- name: Wait for Kafka
run: bundle exec bin/wait_for_kafka
- name: Run all tests
env:
GITHUB_COVERAGE: ${{matrix.coverage}}
KARAFKA_PRO_LICENSE_TOKEN: ${{ secrets.KARAFKA_PRO_LICENSE_TOKEN }}
run: bin/rspecs
- name: Check Kafka logs for unexpected warnings
run: bin/verify_kafka_warnings
- name: Check test topics naming convention
run: bin/verify_topics_naming
diffend:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@6c79f721fa26dd64559c2700086ac852c18e0756
with:
ruby-version: 3.4
bundler-cache: true
- name: Install Diffend plugin
run: bundle plugin install diffend
- name: Bundle Secure
run: bundle secure
coditsu:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
with:
fetch-depth: 0
- name: Download Coditsu script
run: |
curl -sSL https://api.coditsu.io/run/ci -o coditsu_script.sh
chmod +x coditsu_script.sh
- name: Verify Coditsu script checksum
run: |
EXPECTED_SHA256="0aecc5aa010f53fca264548a41467a2b0a1208d750ce1da3e98a217304cacbbc"
ACTUAL_SHA256=$(sha256sum coditsu_script.sh | awk '{ print $1 }')
if [ "$ACTUAL_SHA256" != "$EXPECTED_SHA256" ]; then
echo "::error::Checksum verification failed. Expected $EXPECTED_SHA256 but got $ACTUAL_SHA256."
exit 1
fi
- name: Run Coditsu
env:
CODITSU_API_KEY: ${{ secrets.CODITSU_API_KEY }}
CODITSU_API_SECRET: ${{ secrets.CODITSU_API_SECRET }}
run: ./coditsu_script.sh
assets:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
- name: Set up Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e
with:
node-version: '17'
cache: npm
- name: Cache node modules
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Build development assets
run: ./bin/build_assets
- name: Build release assets
run: KARAFKA_RELEASE=true ./bin/build_assets