From f1ff2834e39a6af3d07e5a4a23d93d9b4edbe637 Mon Sep 17 00:00:00 2001 From: Dan Swain Date: Sat, 7 Nov 2020 09:03:38 -0500 Subject: [PATCH 1/6] Add github actions file (no kafka yet) --- .github/workflows/elixir.yml | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/elixir.yml diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml new file mode 100644 index 00000000..e3b8020e --- /dev/null +++ b/.github/workflows/elixir.yml @@ -0,0 +1,41 @@ +name: Elixir CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + MIX_ENV: test + +jobs: + build: + + runs-on: ubuntu-18.04 + + strategy: + matrix: + include: + - elixir: 1.10.2 + erlang: 22.3 + + steps: + - uses: actions/checkout@v2 + - name: Setup elixir + uses: actions/setup-elixir@v1 + with: + elixir-version: ${{matrix.elixir}} # Define the elixir version [required] + otp-version: ${{matrix.erlang}} # Define the OTP version [required] + - name: Install Dependencies + run: mix deps.get + - name: Build Dependencies + run: mix deps.compile + - name: Compile + run: mix compile --warnings-as-errors + - name: Check format + run: mix format --check-formatted + - name: Credo + run: mix credo --strict + - name: Run Tests + run: mix test From a8cb67c02f9fe9906405d01dd9f7140bc19f6c0e Mon Sep 17 00:00:00 2001 From: Dan Swain Date: Sat, 7 Nov 2020 09:05:08 -0500 Subject: [PATCH 2/6] Remove .travis.yml --- .travis.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 594e03fb..00000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: elixir -branches: - only: - - "master" -cache: - directories: - - deps - - _build -matrix: - include: - - elixir: 1.9.4 - otp_release: 22.3.3 - env: COVERALLS=true CREDO=true - - elixir: 1.8.2 - otp_release: 22.3.3 - - elixir: 1.7.4 - otp_release: 22.3.3 - - elixir: 1.6.6 - otp_release: 20.3 -services: - - docker -env: - global: - - COVERALLS=false - - CREDO=false -before_script: - - ./scripts/docker_up.sh -script: - - MIX_ENV=test mix deps.compile - - MIX_ENV=test mix compile --warnings-as-errors - - ./scripts/ci_tests.sh From 0e118b22b27c5a25214dae0df70400e2d383bca5 Mon Sep 17 00:00:00 2001 From: Dan Swain Date: Sat, 7 Nov 2020 09:07:43 -0500 Subject: [PATCH 3/6] Add docker-compose up --- .github/workflows/elixir.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index e3b8020e..069dce3c 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -22,6 +22,8 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Docker-compose up + run: ./scripts/docker_up.sh - name: Setup elixir uses: actions/setup-elixir@v1 with: @@ -33,9 +35,5 @@ jobs: run: mix deps.compile - name: Compile run: mix compile --warnings-as-errors - - name: Check format - run: mix format --check-formatted - - name: Credo - run: mix credo --strict - name: Run Tests run: mix test From e539d4de13f03223059575233e724a5ceaa851e8 Mon Sep 17 00:00:00 2001 From: Dan Swain Date: Sat, 7 Nov 2020 09:14:36 -0500 Subject: [PATCH 4/6] Run integration tests --- .github/workflows/elixir.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 069dce3c..dbf0a235 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -36,4 +36,4 @@ jobs: - name: Compile run: mix compile --warnings-as-errors - name: Run Tests - run: mix test + run: ./scripts/ci_tests.sh From 13fba983df451c900790fb4d9b3938e004624b6a Mon Sep 17 00:00:00 2001 From: Dan Swain Date: Sat, 7 Nov 2020 09:31:07 -0500 Subject: [PATCH 5/6] Docker ps --- .github/workflows/elixir.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index dbf0a235..ac43e94f 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -35,5 +35,7 @@ jobs: run: mix deps.compile - name: Compile run: mix compile --warnings-as-errors + - name: Docker ps + run: docker ps - name: Run Tests run: ./scripts/ci_tests.sh From c5e78b00fbe9963cbb599477134de293994c06c0 Mon Sep 17 00:00:00 2001 From: Dan Swain Date: Sat, 7 Nov 2020 10:06:26 -0500 Subject: [PATCH 6/6] Try services --- .github/workflows/elixir.yml | 84 ++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index ac43e94f..a4ca97e9 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -20,6 +20,90 @@ jobs: - elixir: 1.10.2 erlang: 22.3 + services: + zookeeper: + image: wurstmeister/zookeeper:3.4.6 + ports: + - "2181:2181" + healthcheck: + test: ["CMD-SHELL", "echo ruok | nc -w 2 127.0.0.1 2181 | grep -q imok"] + interval: 5s + timeout: 10s + retries: 15 + start_period: 10s + + kafka1: + hostname: kafka1 + image: wurstmeister/kafka:0.11.0.1 + ports: + - "9093:9093" + volumes: + - ./ssl:/ssl + - ./scripts/kafka_check_health:/kafka_check_health + env_file: docker-compose-kafka.env + environment: + KAFKA_BROKER_ID: 1 + KAFKA_ADVERTISED_PORT: 9093 + KAFKA_PORT: 9092 + KAFKA_HOST_NAME: kafka1 + healthcheck: + test: /kafka_check_health + interval: 10s + timeout: 10s + retries: 30 + start_period: 10s + depends_on: + zookeeper: + condition: service_healthy + + kafka2: + hostname: kafka2 + image: wurstmeister/kafka:0.11.0.1 + ports: + - "9094:9094" + volumes: + - ./ssl:/ssl + - ./scripts/kafka_check_health:/kafka_check_health + env_file: docker-compose-kafka.env + environment: + KAFKA_BROKER_ID: 2 + KAFKA_ADVERTISED_PORT: 9094 + KAFKA_PORT: 9092 + KAFKA_HOST_NAME: kafka2 + healthcheck: + test: /kafka_check_health + interval: 10s + timeout: 10s + retries: 30 + start_period: 10s + depends_on: + zookeeper: + condition: service_healthy + + kafka3: + hostname: kafka3 + image: wurstmeister/kafka:0.11.0.1 + ports: + - "9095:9095" + volumes: + - ./ssl:/ssl + - ./scripts/kafka_check_health:/kafka_check_health + env_file: docker-compose-kafka.env + environment: + KAFKA_BROKER_ID: 3 + KAFKA_ADVERTISED_PORT: 9095 + KAFKA_PORT: 9092 + KAFKA_HOST_NAME: kafka3 + healthcheck: + test: /kafka_check_health + interval: 10s + timeout: 10s + retries: 30 + start_period: 10s + depends_on: + zookeeper: + condition: service_healthy + steps: - uses: actions/checkout@v2 - name: Docker-compose up