diff --git a/.github/workflows/tests-workflow.yml b/.github/workflows/tests-workflow.yml new file mode 100644 index 0000000..70a9145 --- /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 }} + 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@v4 + + - name: Run Tests + run: make test + + - name: Run Dialyzer + run: make dialyzer 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/.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/CHANGELOG.markdown b/CHANGELOG.markdown index f065053..f44c11c 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -1,3 +1,18 @@ +## 0.7.3 + +* Remove the `?else` macro. + +## 0.7.2 + +* Update the error message when qdate is not started with some better instructions. +* Some minor updates for hex.pm +* Removed the `erlnow()` warning +* Fix some typos in the documentation +* Update the makefile to use [rebar3.mk](https://rebar3.mk) +* Skipped 0.7.1 only because there was a partially tagged 0.7.1 for a while, + but was never published to hex. Just to ensure upgrades are easier, I just skipped + a proper 0.7.1 release + ## 0.7.0 * Re-introduce the qdate server for storing qdate timezones, formats, and parsers, diff --git a/Makefile b/Makefile index 5436322..de4d762 100644 --- a/Makefile +++ b/Makefile @@ -15,13 +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 - -travis: test dialyzer + DIALYZER=1 $(REBAR) dialyzer dev: mkdir -p _checkouts 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 diff --git a/rebar3 b/rebar3 deleted file mode 100755 index 6f0ccfa..0000000 Binary files a/rebar3 and /dev/null differ diff --git a/src/qdate.erl b/src/qdate.erl index 61f58b3..7027b27 100644 --- a/src/qdate.erl +++ b/src/qdate.erl @@ -162,7 +162,6 @@ -define(DETERMINE_TZ, determine_timezone()). -define(DEFAULT_DISAMBIG, prefer_standard). --define(else, true). start() -> @@ -1088,7 +1087,7 @@ date_tz_to_tz_both(Date, FromTZ, ToTZ) -> if Standard=:=Daylight -> Standard; - ?else -> + true -> {ambiguous, Standard, Daylight} end. @@ -1207,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 @@ -1530,3 +1531,5 @@ microsoft_parser(_) -> stop_test(_) -> ok. + +-endif.