From 06347e7f31dd47b08f049fd07af31e7132b7cbf3 Mon Sep 17 00:00:00 2001 From: Jesse Gumm Date: Thu, 5 Sep 2024 14:35:38 -0500 Subject: [PATCH 1/5] Add github actions workflow --- .github/workflows/tests-workflow.yml | 47 ++++++++++++++++++++++++++++ CHANGELOG.markdown | 4 +++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/tests-workflow.yml diff --git a/.github/workflows/tests-workflow.yml b/.github/workflows/tests-workflow.yml new file mode 100644 index 0000000..964e68b --- /dev/null +++ b/.github/workflows/tests-workflow.yml @@ -0,0 +1,47 @@ +name: qdate tests and dialyzer +on: push + +jobs: + linux: + name: OTP ${{ matrix.otp_version }} (${{ matrix.mysql }}/PG ${{ matrix.pg}}) + runs-on: ${{ matrix.os }} + continue-on-error: true + + strategy: + matrix: + include: + - os: ubuntu-22.04 + otp_version: '27.x' + rebar3_version: "3.24.0" + - os: ubuntu-22.04 + otp_version: '27.x' + rebar3_version: "3.23.0" + - os: ubuntu-22.04 + otp_version: '26.x' + rebar3_version: "3.22.1" + - os: ubuntu-22.04 + otp_version: '25.x' + rebar3_version: "3.22.1" + - os: ubuntu-22.04 + otp_version: '24.x' + rebar3_version: "3.22.1" + - os: ubuntu-20.04 + otp_version: '23.x' + rebar3_version: "3.19.0" + + steps: + - name: Install OTP ${{matrix.otp_version}} + uses: erlef/setup-beam@v1 + with: + version-type: loose + otp-version: ${{ matrix.otp_version}} + rebar3-version: ${{ matrix.rebar3_version}} + + - name: Checkout qdate + uses: actions/checkout@v3 + + - name: Run Tests + run: make test + + - name: Run Dialyzer + run: make dialyzer diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index 270b5c8..f44c11c 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -1,3 +1,7 @@ +## 0.7.3 + +* Remove the `?else` macro. + ## 0.7.2 * Update the error message when qdate is not started with some better instructions. From 70bab7df95e139832868ff9423f5d172fc1f86fe Mon Sep 17 00:00:00 2001 From: Jesse Gumm Date: Thu, 5 Sep 2024 14:55:48 -0500 Subject: [PATCH 2/5] Updates to fix dialyzer failing on otp 26+ --- .gitignore | 1 + Makefile | 7 ++++--- src/qdate.erl | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 253f03c..6ff84d8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ ebin/ .eunit/ .idea/ _build +doc/ diff --git a/Makefile b/Makefile index 5436322..e6f8894 100644 --- a/Makefile +++ b/Makefile @@ -15,11 +15,12 @@ compile: rebar3 update: rebar3 $(REBAR) update -test: compile - $(REBAR) eunit +test: + EUNIT=1 $(REBAR) compile + EUNIT=1 $(REBAR) eunit dialyzer: compile - $(REBAR) dialyzer + DIALYZER=1 $(REBAR) dialyzer travis: test dialyzer diff --git a/src/qdate.erl b/src/qdate.erl index 0de40b6..7027b27 100644 --- a/src/qdate.erl +++ b/src/qdate.erl @@ -1206,6 +1206,8 @@ flooring(N) when N < 0 -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TESTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-ifdef(EUNIT). + -include_lib("eunit/include/eunit.hrl"). %% emulates as if a forum-type website has a Site tz, and a user-specified tz @@ -1529,3 +1531,5 @@ microsoft_parser(_) -> stop_test(_) -> ok. + +-endif. From dc2184ea0652a328fca588457297ea6f49cad4b2 Mon Sep 17 00:00:00 2001 From: Jesse Gumm Date: Thu, 5 Sep 2024 14:56:59 -0500 Subject: [PATCH 3/5] Remove reference to Postgres/MySQL (GH actions config was largely copied from sql_bridge) --- .github/workflows/tests-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-workflow.yml b/.github/workflows/tests-workflow.yml index 964e68b..4e0102d 100644 --- a/.github/workflows/tests-workflow.yml +++ b/.github/workflows/tests-workflow.yml @@ -3,7 +3,7 @@ on: push jobs: linux: - name: OTP ${{ matrix.otp_version }} (${{ matrix.mysql }}/PG ${{ matrix.pg}}) + name: OTP ${{ matrix.otp_version }} runs-on: ${{ matrix.os }} continue-on-error: true From 43c1f3412bf05d8d1945adf2fbb553daf88fcd8a Mon Sep 17 00:00:00 2001 From: Jesse Gumm Date: Thu, 5 Sep 2024 15:01:11 -0500 Subject: [PATCH 4/5] Update to checkout@v4 --- .github/workflows/tests-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-workflow.yml b/.github/workflows/tests-workflow.yml index 4e0102d..70a9145 100644 --- a/.github/workflows/tests-workflow.yml +++ b/.github/workflows/tests-workflow.yml @@ -38,7 +38,7 @@ jobs: rebar3-version: ${{ matrix.rebar3_version}} - name: Checkout qdate - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run Tests run: make test From 108c79668779bcbfb37f130ce31cb08f2483bd1d Mon Sep 17 00:00:00 2001 From: Jesse Gumm Date: Thu, 5 Sep 2024 15:04:50 -0500 Subject: [PATCH 5/5] Remove travis and replace badge with GH actions --- .travis.yml | 8 -------- Makefile | 2 -- README.md | 2 +- 3 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5de773f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: erlang -script: "make test" -otp_release: - - 23.0 - - 22.3 - - 21.3 - - 20.3 -before_script: "sudo apt-get --yes --force-yes install libpam-runtime python-software-properties software-properties-common" diff --git a/Makefile b/Makefile index e6f8894..de4d762 100644 --- a/Makefile +++ b/Makefile @@ -22,8 +22,6 @@ test: dialyzer: compile DIALYZER=1 $(REBAR) dialyzer -travis: test dialyzer - dev: mkdir -p _checkouts cd _checkouts; git clone https://github.com/choptastic/qdate_localtime diff --git a/README.md b/README.md index f2c04ae..a462a9b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # qdate - Erlang Date and Timezone Library -[![Build Status](https://travis-ci.org/choptastic/qdate.png?branch=master)](https://travis-ci.org/choptastic/qdate) +[![qdate tests and dialyzer](https://github.com/choptastic/qdate/actions/workflows/tests-workflow.yml/badge.svg)](https://github.com/choptastic/qdate/actions/workflows/tests-workflow.yml) ## Purpose