From 2c9dea7e0f0bbef4f2d4e7cdef2058ce7a808142 Mon Sep 17 00:00:00 2001 From: Gabriel Volpe Date: Fri, 27 Dec 2019 11:11:25 -0300 Subject: [PATCH] GH actions as CI build --- .circleci/config.yml | 45 ---------------------------------------- .github/workflows/ci.yml | 21 +++++++++++++++++++ README.md | 6 +++--- docker-compose.yml | 7 +++++++ 4 files changed, 31 insertions(+), 48 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml create mode 100644 docker-compose.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index d072484d..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Scala CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/sample-config/ for more details -# -version: 2 -jobs: - build: - docker: - # specify the version you desire here - - image: circleci/openjdk:8-jdk - - - image: rabbitmq:alpine - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/postgres:9.4 - - working_directory: ~/repo - - environment: - # Customize the JVM maximum heap limit - JVM_OPTS: -Xmx3200m - SBT_OPTS: -Xms2G -Xmx4G -XX:ReservedCodeCacheSize=512m -XX:MaxMetaspaceSize=1024m - TERM: dumb - - steps: - - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ checksum "build.sbt" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - - run: cat /dev/null | sbt test:compile - - - save_cache: - paths: - - ~/.m2 - key: v1-dependencies--{{ checksum "build.sbt" }} - - # run tests! - - run: cat /dev/null | sbt buildFs2Rabbit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..97d1021e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: Build + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: olafurpg/setup-scala@v5 + - name: Starting up RabbitMQ + run: docker-compose up -d + - name: Tests + run: sbt -J-Xms4G -J-Xmx4G buildFs2Rabbit + - name: Shutting down RabbitMQ + run: docker-compose down diff --git a/README.md b/README.md index 9ac390f8..cf0b1d43 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ fs2-rabbit ========== -[![CircleCI](https://circleci.com/gh/profunktor/fs2-rabbit.svg?style=svg)](https://circleci.com/gh/profunktor/fs2-rabbit) +![CI Status](https://github.com/profunktor/fs2-rabbit/workflows/Build/badge.svg) [![Gitter Chat](https://badges.gitter.im/profunktor-dev/fs2-rabbit.svg)](https://gitter.im/profunktor-dev/fs2-rabbit) [![Maven Central](https://img.shields.io/maven-central/v/dev.profunktor/fs2-rabbit_2.12.svg)](http://search.maven.org/#search%7Cga%7C1%7Cfs2-rabbit) Cats friendly [![MergifyStatus](https://img.shields.io/endpoint.svg?url=https://gh.mergify.io/badges/profunktor/fs2-rabbit&style=flat)](https://mergify.io) @@ -42,10 +42,10 @@ Check the [official guide](https://fs2-rabbit.profunktor.dev/guide.html) for upd ## Running tests locally -Start a `RabbitMQ` instance using `docker` (recommended): +Start a `RabbitMQ` instance using `docker-compose` (recommended): ```bash -> docker run -p 5672:5672 rabbitmq:alpine +> docker-compose up > sbt +test ``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..752f0e0a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +RabbitMQ: + restart: always + image: rabbitmq:alpine + ports: + - "5672:5672" + environment: + - DEBUG=false