From ede5361bc1622af2aa15fd681d4653db8614d05b Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 12 Jun 2021 15:04:11 +0300 Subject: [PATCH] Remove travis-ci related files. Add github workflow. Fix warning on Cocoa build --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 19 ------------------ README.md | 2 +- source/standardpaths.d | 2 ++ 4 files changed, 46 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..49b2e2e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: build +on: + pull_request: + push: + release: + types: [published] + +jobs: + Build: + if: "!contains(github.event.head_commit.message, '[skip ci]')" + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + dc: + - ldc-latest + - dmd-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Setup D + uses: dlang-community/setup-dlang@v1 + with: + compiler: ${{ matrix.dc }} + + - name: Build and run example + run: | + dub build + dub --single examples/printdirs.d + + - name: Build and run example with Cocoa + if: ${{ startsWith(matrix.os, 'macos') }} + run: | + dub build --config=cocoa + dub --single examples/printdirs.d --override-config=standardpaths/cocoa + + - name: Run tests on xdg + if: ${{ startsWith(matrix.os, 'ubuntu') }} + run: | + dub test -b unittest diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 88ae200..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: d -matrix: - include: - - d: dmd - os: linux - env: CONFIG=default - - d: dmd - os: osx - env: CONFIG=default - - d: ldc - os: linux - env: CONFIG=default - - d: ldc - os: osx - env: CONFIG=cocoa - -script: - - dub build --compiler=${DC} --config=${CONFIG} - - dub --single examples/printdirs.d --compiler=${DC} --override-config=standardpaths/${CONFIG} diff --git a/README.md b/README.md index 689b84e..7b23c84 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ D library for getting standard paths (e.g. Pictures, Music, Documents and also generic configuration and data paths). Inspired by QStandardPaths from Qt. -[![Build Status](https://travis-ci.org/FreeSlave/standardpaths.svg?branch=master)](https://travis-ci.org/FreeSlave/standardpaths) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/FreeSlave/standardpaths?branch=master&svg=true)](https://ci.appveyor.com/project/FreeSlave/standardpaths) +[![Build Status](https://github.com/FreeSlave/standardpaths/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/FreeSlave/standardpaths/actions/workflows/ci.yml) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/FreeSlave/standardpaths?branch=master&svg=true)](https://ci.appveyor.com/project/FreeSlave/standardpaths) [Online documentation](http://freeslave.github.io/standardpaths/standardpaths.html) diff --git a/source/standardpaths.d b/source/standardpaths.d index 83fdb29..b68afc3 100644 --- a/source/standardpaths.d +++ b/source/standardpaths.d @@ -692,6 +692,8 @@ version(Windows) { private { import std.string : fromStringz; version(StandardPathsCocoa) { + import core.attribute : selector; + alias size_t NSUInteger; enum objectiveC_declarations = q{