From 42d5477e1abb5eec878f880f56bba446ae7afd56 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Sat, 25 Jun 2022 11:48:11 -0400 Subject: [PATCH 1/2] Added GitHub Actions workflow Signed-off-by: James Turnbull --- .circleci/config.yml | 42 ---------------------- .github/workflows/config.yml | 67 ++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 42 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 6d4ba6b..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,42 +0,0 @@ -version: 2 -shared: &shared - working_directory: ~/riemann-clojure-client - environment: - JVM_OPTS: -Xmx3200m - LEIN_ROOT: nbd - steps: - - checkout - - restore_cache: # restores saved cache if checksum hasn't changed since the last run - key: riemann-clojure-client-{{ checksum "project.clj" }} - - run: lein deps - - save_cache: # generate and store cache in the .m2 directory using a key template - paths: - - ~/.m2 - - ~/.lein - key: riemann-clojure-client-{{ checksum "project.clj" }} - - run: - command: scripts/run_riemann_server.sh - background: true - - run: - command: sleep 30 - - run: lein test2junit - - store_test_results: - path: target/test2junit - -jobs: - jdk11: - docker: # run the steps with Docker - - image: circleci/clojure:openjdk-11-lein-2.9.1 - <<: *shared - jdk8: - docker: # run the steps with Docker - - image: circleci/clojure:openjdk-8-lein-2.9.1 - <<: *shared - -workflows: - version: 2 - test: - jobs: - - jdk8 - - jdk11 - diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml new file mode 100644 index 0000000..d9c2e66 --- /dev/null +++ b/.github/workflows/config.yml @@ -0,0 +1,67 @@ +name: Riemann Clojure Client testing + +on: [push] + +jobs: + test: + + strategy: + matrix: + java: [ '8', '11', '13', '15', '16', '17' ] + name: Java ${{ matrix.Java }} + + runs-on: ubuntu-latest + + env: + JVM_OPTS: -Xmx3200m + LEIN_ROOT: nbd + + steps: + - uses: actions/checkout@v3 + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: ${{ matrix.java }} + - name: Install clojure tools + uses: DeLaGuardo/setup-clojure@7.0 + with: + cli: 1.10.1.693 # Clojure CLI based on tools.deps + lein: 2.9.1 # Leiningen + - name: Install deps + run: lein deps + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ matrix.java }}-maven-${{ hashFiles('**/project.clj') }} + - name: Run Riemann server + run: scripts/run_riemann_server.sh + - name: Run test2junit + run: lein test2junit + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v3 + with: + name: Test Results (Java ${{ matrix.java }}) + path: target/test2junit/ + + publish-test-results: + name: "Publish Tests Results" + needs: test + runs-on: ubuntu-latest + permissions: + checks: write + pull-requests: write + if: always() + + steps: + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + path: artifacts + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v1 + with: + files: "artifacts/**/*.xml" From 70b85a1698465763178e1462726e424c6e17eec7 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Sat, 25 Jun 2022 11:57:47 -0400 Subject: [PATCH 2/2] Run it as a service instead Signed-off-by: James Turnbull --- .github/workflows/config.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index d9c2e66..72f7cd1 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -12,6 +12,15 @@ jobs: runs-on: ubuntu-latest + services: + riemann: + image: riemannio/riemann:latest + ports: + - 5555:5555 + - 5555:5555/udp + - 5556:5556 + - 2003:2003 + env: JVM_OPTS: -Xmx3200m LEIN_ROOT: nbd @@ -35,8 +44,6 @@ jobs: with: path: ~/.m2/repository key: ${{ matrix.java }}-maven-${{ hashFiles('**/project.clj') }} - - name: Run Riemann server - run: scripts/run_riemann_server.sh - name: Run test2junit run: lein test2junit - name: Upload Test Results