From 25b9e95128016120b0d9f9085a9f34fd87e16780 Mon Sep 17 00:00:00 2001 From: SingingBush Date: Wed, 9 Jun 2021 20:11:47 +0100 Subject: [PATCH 1/5] added .editorconfig file --- .editorconfig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0ba5a74 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# EditorConfig allows multiple IDE's to use same formatting rules: https://EditorConfig.org +root = true + +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true +charset = utf-8 + +[*.yml] +indent_size = 2 +insert_final_newline = false \ No newline at end of file From d15aa3fb07711655792c990fd6c274abe148921d Mon Sep 17 00:00:00 2001 From: SingingBush Date: Wed, 9 Jun 2021 20:48:24 +0100 Subject: [PATCH 2/5] use Github Actions for CI instead of travis-ci --- .github/workflows/dub.yml | 81 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/dub.yml diff --git a/.github/workflows/dub.yml b/.github/workflows/dub.yml new file mode 100644 index 0000000..186c061 --- /dev/null +++ b/.github/workflows/dub.yml @@ -0,0 +1,81 @@ +name: CI + +# Overall Poodinis should work on a fairly wide variety of D versions. Similar to Vibe.d, the last +# 10 compiler releases should certainly be supported. As GCC supports D version 2.076, this should +# continue to be supported. + +on: + schedule: + - cron: '45 6 1 * *' + push: + pull_request: + branches: [ main ] + +jobs: + test: + name: ${{ matrix.compiler }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + compiler: + - dmd-latest + - ldc-latest + - dmd-2.096.1 + - dmd-2.095.1 + - dmd-2.094.2 + - dmd-2.093.1 + - dmd-2.092.1 + - dmd-2.091.1 + - dmd-2.090.1 + - dmd-2.089.1 + - dmd-2.088.1 + - dmd-2.087.1 + - dmd-2.086.1 + - dmd-2.085.1 + - dmd-2.077.1 + - dmd-2.076.1 # gdc (gcc v9 - v11.1) supports D at this version + - dmd-2.075.1 + - dmd-2.074.1 + - dmd-2.073.2 + - dmd-2.072.2 + - dmd-2.071.2 + - dmd-2.070.2 + - dmd-2.069.2 + - ldc-1.25.1 # eq to dmd v2.095.1 + - ldc-1.24.0 # eq to dmd v2.094.1 + - ldc-1.23.0 # eq to dmd v2.093.1 +# - ldc-1.22.0 # eq to dmd v2.092.1 +# - ldc-1.21.0 # eq to dmd v2.091.1 +# - ldc-1.20.1 # eq to dmd v2.090.1 +# - ldc-1.19.0 # eq to dmd v2.089.1 +# - ldc-1.18.0 # eq to dmd v2.088.1 +# - ldc-1.17.0 # eq to dmd v2.087 +# - ldc-1.16.0 # eq to dmd v2.086.1 + - ldc-1.15.0 # eq to dmd v2.085.1 + steps: + - uses: actions/checkout@v2 + + - name: Install D ${{ matrix.compiler }} + uses: dlang-community/setup-dlang@v1 + with: + compiler: ${{ matrix.compiler }} + + - name: Build library + run: dub build --build=release --config=library + + - name: Build unittest + run: dub test --build=unittest --config=unittest + + - name: Build examples + run: | + dub run --build=release --config=quickstartExample + dub run --build=release --config=qualifiersExample + dub run --build=release --config=arrayCompletionExample + dub run --build=release --config=annotationsExample + dub run --build=release --config=applicationContextExample + dub run --build=release --config=registerOnResolveExample + dub run --build=release --config=constructorInjectionExample + dub run --build=release --config=valueInjectionExample + dub run --build=release --config=postConstructorPreDestructorExample From c4d4e5e82f7b08e6929af1ef479fe958fa0109f0 Mon Sep 17 00:00:00 2001 From: SingingBush Date: Wed, 9 Jun 2021 21:08:53 +0100 Subject: [PATCH 3/5] split CI into two jobs --- .github/workflows/dub.yml | 54 ++++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dub.yml b/.github/workflows/dub.yml index 186c061..624748f 100644 --- a/.github/workflows/dub.yml +++ b/.github/workflows/dub.yml @@ -3,6 +3,11 @@ name: CI # Overall Poodinis should work on a fairly wide variety of D versions. Similar to Vibe.d, the last # 10 compiler releases should certainly be supported. As GCC supports D version 2.076, this should # continue to be supported. +# +# While testing I found: +# Ubuntu builds work with D >= 2.072 +# Windows builds work with D >= 2.075 +# Mac builds work with D >= 2.088 on: schedule: @@ -12,7 +17,8 @@ on: branches: [ main ] jobs: - test: + # Make sure the latest versions of dub and ldc work on all platforms + build-latest: name: ${{ matrix.compiler }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: @@ -22,6 +28,43 @@ jobs: compiler: - dmd-latest - ldc-latest + steps: + - uses: actions/checkout@v2 + + - name: Install D ${{ matrix.compiler }} + uses: dlang-community/setup-dlang@v1 + with: + compiler: ${{ matrix.compiler }} + + - name: Build library + run: dub build --build=release --config=library + + - name: Build unittest + run: dub test --build=unittest --config=unittest + + - name: Build examples + run: | + dub run --build=release --config=quickstartExample + dub run --build=release --config=qualifiersExample + dub run --build=release --config=arrayCompletionExample + dub run --build=release --config=annotationsExample + dub run --build=release --config=applicationContextExample + dub run --build=release --config=registerOnResolveExample + dub run --build=release --config=constructorInjectionExample + dub run --build=release --config=valueInjectionExample + dub run --build=release --config=postConstructorPreDestructorExample + + # Ensure poodinis can build on everything from 2.076 to latest. These builds are Ubuntu only for speed + build-older: + name: ${{ matrix.compiler }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest ] + compiler: + - dmd-latest + - ldc-latest - dmd-2.096.1 - dmd-2.095.1 - dmd-2.094.2 @@ -30,19 +73,12 @@ jobs: - dmd-2.091.1 - dmd-2.090.1 - dmd-2.089.1 - - dmd-2.088.1 + - dmd-2.088.1 # mac-latest is ok with dmd-2.088 or higher but the ldc versions can be a problem - dmd-2.087.1 - dmd-2.086.1 - dmd-2.085.1 - dmd-2.077.1 - dmd-2.076.1 # gdc (gcc v9 - v11.1) supports D at this version - - dmd-2.075.1 - - dmd-2.074.1 - - dmd-2.073.2 - - dmd-2.072.2 - - dmd-2.071.2 - - dmd-2.070.2 - - dmd-2.069.2 - ldc-1.25.1 # eq to dmd v2.095.1 - ldc-1.24.0 # eq to dmd v2.094.1 - ldc-1.23.0 # eq to dmd v2.093.1 From 729a50ee909326e0951c079424d1d3c2c06e387a Mon Sep 17 00:00:00 2001 From: SingingBush Date: Wed, 9 Jun 2021 21:22:26 +0100 Subject: [PATCH 4/5] remove travis.yml and update README --- .github/workflows/dub.yml | 10 ++++---- .travis.yml | 54 --------------------------------------- README.md | 2 +- 3 files changed, 6 insertions(+), 60 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/dub.yml b/.github/workflows/dub.yml index 624748f..6dc2174 100644 --- a/.github/workflows/dub.yml +++ b/.github/workflows/dub.yml @@ -74,12 +74,12 @@ jobs: - dmd-2.090.1 - dmd-2.089.1 - dmd-2.088.1 # mac-latest is ok with dmd-2.088 or higher but the ldc versions can be a problem - - dmd-2.087.1 - - dmd-2.086.1 - - dmd-2.085.1 - - dmd-2.077.1 +# - dmd-2.087.1 +# - dmd-2.086.1 +# - dmd-2.085.1 +# - dmd-2.077.1 - dmd-2.076.1 # gdc (gcc v9 - v11.1) supports D at this version - - ldc-1.25.1 # eq to dmd v2.095.1 +# - ldc-1.25.1 # eq to dmd v2.095.1 (excluded as this version seemed to be a bad release) - ldc-1.24.0 # eq to dmd v2.094.1 - ldc-1.23.0 # eq to dmd v2.093.1 # - ldc-1.22.0 # eq to dmd v2.092.1 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ca64597..0000000 --- a/.travis.yml +++ /dev/null @@ -1,54 +0,0 @@ -language: d - -# For available compilers see: https://semitwist.com/travis-d-compilers -d: - - dmd - - dmd-beta - - dmd-2.077.1 - - dmd-2.076.1 - - dmd-2.075.1 - - dmd-2.074.1 - - dmd-2.073.2 - - dmd-2.072.2 - - dmd-2.071.2 - - dmd-2.070.2 - - dmd-2.069.2 - - ldc - - ldc-beta - - ldc-1.6.0 # D v2.076.1 - - ldc-1.5.0 # D v2.075.1 - - ldc-1.4.0 # D v2.074.1 - - ldc-1.3.0 # D v2.073.2 - - ldc-1.2.0 # D v2.072.2 - - ldc-1.1.1 # D v2.071.2 - - gdc - -sudo: false - -os: - - linux - - osx - -script: - - dub build --build=release --config=library - - dub test --build=unittest --config=unittest - - dub run --build=release --config=quickstartExample - - dub run --build=release --config=qualifiersExample - - dub run --build=release --config=arrayCompletionExample - - dub run --build=release --config=annotationsExample - - dub run --build=release --config=applicationContextExample - - dub run --build=release --config=registerOnResolveExample - - dub run --build=release --config=constructorInjectionExample - - dub run --build=release --config=valueInjectionExample - - dub run --build=release --config=postConstructorPreDestructorExample - -matrix: - allow_failures: - - d: gdc - os: osx - - d: ldc-1.4.0 - os: osx - - d: ldc-1.3.0 - os: osx - - d: ldc-1.2.0 - os: osx diff --git a/README.md b/README.md index 94b28d1..e6e6eca 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Version 8.0.3 Copyright 2014-2021 Mike Bierlee Licensed under the terms of the MIT license - See [LICENSE.txt](LICENSE.txt) -Main: [![Build Status](https://api.travis-ci.org/mbierlee/poodinis.png?branch=main)](https://travis-ci.org/mbierlee/poodinis) - Dev: [![Build Status](https://api.travis-ci.org/mbierlee/poodinis.png?branch=develop)](https://travis-ci.org/mbierlee/poodinis) +[![DUB Package](https://img.shields.io/dub/v/poodinis.svg)](https://code.dlang.org/packages/poodinis) [![CI](https://github.com/mbierlee/poodinis/actions/workflows/dub.yml/badge.svg)](https://github.com/mbierlee/poodinis/actions/workflows/dub.yml) Poodinis is a dependency injection framework for the D programming language. It is inspired by the [Spring Framework] and [Hypodermic] IoC container for C++. Poodinis supports registering and resolving classes either by concrete type or interface. Automatic injection of dependencies is supported through the use of UDAs or constructors. From de23574cfbfb7183345129ffc9fd887e69e2bec1 Mon Sep 17 00:00:00 2001 From: SingingBush Date: Wed, 9 Jun 2021 22:42:45 +0100 Subject: [PATCH 5/5] Also test on GDC (Ubuntu only) --- .github/workflows/dub.yml | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/dub.yml b/.github/workflows/dub.yml index 6dc2174..692b800 100644 --- a/.github/workflows/dub.yml +++ b/.github/workflows/dub.yml @@ -115,3 +115,45 @@ jobs: dub run --build=release --config=constructorInjectionExample dub run --build=release --config=valueInjectionExample dub run --build=release --config=postConstructorPreDestructorExample + + # On Ubuntu we can use GDC (so keep working for D version 2.076) + gdc-latest: + name: GDC on Ubuntu + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install DMD (so dub is available) + uses: dlang-community/setup-dlang@v1 + with: + compiler: dmd-latest + + - name: Install GDC + run: | + sudo apt-get update + sudo apt-get install gdc -y + gdc --version + + - name: Build library + env: + DC: gdc + run: dub build --compiler=gdc --build=release --config=library + + - name: Build unittest + env: + DC: gdc + run: dub test --compiler=gdc --build=unittest --config=unittest + + - name: Build examples + env: + DC: gdc + run: | + dub run --compiler=gdc --build=release --config=quickstartExample + dub run --compiler=gdc --build=release --config=qualifiersExample + dub run --compiler=gdc --build=release --config=arrayCompletionExample + dub run --compiler=gdc --build=release --config=annotationsExample + dub run --compiler=gdc --build=release --config=applicationContextExample + dub run --compiler=gdc --build=release --config=registerOnResolveExample + dub run --compiler=gdc --build=release --config=constructorInjectionExample + dub run --compiler=gdc --build=release --config=valueInjectionExample + dub run --compiler=gdc --build=release --config=postConstructorPreDestructorExample \ No newline at end of file