Browse Source

Replace Travis with GitHub CI

Sergey Prokhorov 2 years ago
parent
commit
cbb20049bf
6 changed files with 68 additions and 18 deletions
  1. 50 0
      .github/workflows/ci.yml
  2. 0 12
      .travis.yml
  3. 6 2
      Makefile
  4. 2 2
      README.org
  5. 9 1
      rebar.config
  6. 1 1
      src/pooler.app.src

+ 50 - 0
.github/workflows/ci.yml

@@ -0,0 +1,50 @@
+name: CI
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+    branches:
+      - master
+jobs:
+  ci:
+    name: Run checks and tests over ${{matrix.otp}} and ${{matrix.os}}
+    runs-on: ${{matrix.os}}
+
+    strategy:
+      fail-fast: false
+      matrix:
+        otp: ["22.3", "23.3"]
+        os: ["ubuntu-20.04"]
+        rebar3: ["3.17.0"]
+        include:
+          - os: "ubuntu-20.04"
+            otp: "21.3"
+            rebar3: "3.15.2"
+          - os: "ubuntu-20.04"
+            otp: "20.3"
+            rebar3: "3.15.2"
+
+    steps:
+      - uses: actions/checkout@v3
+
+      - uses: erlef/setup-beam@v1
+        with:
+          otp-version: ${{ matrix.otp }}
+          rebar3-version: ${{ matrix.rebar3 }}
+
+      - name: Compile
+        run: make
+
+      - name: xref
+        run: make xref
+        if: ${{ matrix.otp != '23.3' }}
+
+      - name: Eunit test
+        run: make test
+
+      - name: Generate docs
+        run: make doc
+
+      - name: Dialyze
+        run: make dialyzer

+ 0 - 12
.travis.yml

@@ -1,12 +0,0 @@
-language: erlang
-otp_release:
-  - 21.0
-  - 20.3
-  - 19.3
-  - 18.3
-  - 17.5
-  - R16B03
-script:
-  - make test
-before_script:
-  - "kerl list installations"

+ 6 - 2
Makefile

@@ -1,6 +1,7 @@
 .PHONY: all compile run test doc clean
 
 REBAR=$(shell which rebar3 || echo ./rebar3)
+MINIMAL_COVERAGE=80
 
 all: compile
 
@@ -11,8 +12,11 @@ run: $(REBAR)
 	@$(REBAR) as dev shell --apps pooler --config config/demo.config
 
 test: $(REBAR)
-	$(REBAR) eunit --cover skip_deps=true verbose=3
-	$(REBAR) cover
+	$(REBAR) eunit --cover verbose=3
+	$(REBAR) cover --verbose --min_coverage $(MINIMAL_COVERAGE)
+
+xref: $(REBAR)
+	$(REBAR) xref
 
 doc: $(REBAR)
 	$(REBAR) as dev edoc

+ 2 - 2
README.org

@@ -5,7 +5,7 @@ such as gen_servers, gen_fsms, or supervisors, and provide consumers
 with exclusive access to pool members using =pooler:take_member=.
 
 #+ATTR_HTML: alt="Build status images" title="Build status on Travis-CI"
-[[https://travis-ci.org/seth/pooler][https://travis-ci.org/seth/pooler.svg?branch=master]]
+https://github.com/epgsql/pooler/actions/workflows/ci.yml/badge.svg
 
 ** What pooler does
 
@@ -257,7 +257,7 @@ When enabled, the following metrics will be tracked:
 
 1. Clone the repo:
    #+BEGIN_EXAMPLE
-   git clone https://github.com/seth/pooler.git
+   git clone https://github.com/epgsql/pooler.git
    #+END_EXAMPLE
 2. Build and run tests:
    #+BEGIN_EXAMPLE

+ 9 - 1
rebar.config

@@ -1,7 +1,7 @@
 {erl_opts, [
     {platform_define, "^[0-9]+", namespaced_types},
     {platform_define, "^(19|2)", rand_only},
-    {platform_define, "^(R|1|20)", fun_stacktrace},
+    {platform_define, "^(1|20)", fun_stacktrace},
 
 
     debug_info,
@@ -57,3 +57,11 @@
 {cover_enabled, true}.
 {cover_print_enabled, true}.
 
+{xref_checks, [
+    undefined_function_calls,
+    undefined_functions,
+    locals_not_used,
+    %% exports_not_used,
+    deprecated_function_calls,
+    deprecated_functions
+]}.

+ 1 - 1
src/pooler.app.src

@@ -1,6 +1,6 @@
 {application, pooler,
  [
-  {description, ""},
+  {description, "An OTP Process Pool Application"},
   {vsn, git},
   {registered, []},
   {applications, [