From e1ed577d747cf75740125ba76f0cbfed100648f9 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 24 Mar 2021 18:11:23 +0300 Subject: project.ci: use same variable names for all CIs Using different ones was quite weird to begin with. --- .github/workflows/ci_appveyor.yml | 2 +- .github/workflows/ci_github.yml | 8 ++++---- .github/workflows/ci_travis.yml | 6 +++--- README.md | 8 ++++---- project/ci/dirs.py | 30 +++++------------------------- 5 files changed, 17 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci_appveyor.yml b/.github/workflows/ci_appveyor.yml index da12953..f27f43b 100644 --- a/.github/workflows/ci_appveyor.yml +++ b/.github/workflows/ci_appveyor.yml @@ -30,7 +30,7 @@ jobs: APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 PLATFORM: '${{ matrix.platform }}' CONFIGURATION: '${{ matrix.configuration }}' - boost_version: 1.72.0 + BOOST_VERSION: 1.72.0 defaults: run: diff --git a/.github/workflows/ci_github.yml b/.github/workflows/ci_github.yml index 91b1c96..897e37e 100644 --- a/.github/workflows/ci_github.yml +++ b/.github/workflows/ci_github.yml @@ -27,10 +27,10 @@ jobs: name: '${{ matrix.os }} / ${{ matrix.toolset }} / ${{ matrix.configuration }}' env: - toolset: '${{ matrix.toolset }}' - platform: x64 - configuration: '${{ matrix.configuration }}' - boost_version: 1.72.0 + TOOLSET: '${{ matrix.toolset }}' + PLATFORM: x64 + CONFIGURATION: '${{ matrix.configuration }}' + BOOST_VERSION: 1.72.0 defaults: run: diff --git a/.github/workflows/ci_travis.yml b/.github/workflows/ci_travis.yml index c585f57..3ee4550 100644 --- a/.github/workflows/ci_travis.yml +++ b/.github/workflows/ci_travis.yml @@ -25,9 +25,9 @@ jobs: # https://docs.travis-ci.com/user/environment-variables/#default-environment-variables TRAVIS: 'true' TRAVIS_BUILD_DIR: '${{ github.workspace }}/examples/boost' - platform: x64 - configuration: '${{ matrix.configuration }}' - boost_version: 1.72.0 + PLATFORM: x64 + CONFIGURATION: '${{ matrix.configuration }}' + BOOST_VERSION: 1.72.0 defaults: run: diff --git a/README.md b/README.md index d8b4b10..23e100f 100644 --- a/README.md +++ b/README.md @@ -89,10 +89,10 @@ parameters from environment variables. | | Travis | AppVeyor | GitHub Actions | ----------------- | ------------------------------------ | ------------------------------------------ | ------------------------------------ -| `--toolset` | `$toolset` | `%toolset%` | `$toolset` -| `--platform` | `$platform` | `%PLATFORM%` | `$platform` -| `--configuration` | `$configuration` | `%CONFIGURATION%` | `$configuration` -| Boost version | `$boost_version` | `%boost_version%` | `$boost_version` +| `--toolset` | `$TOOLSET` | `%TOOLSET%` | `$TOOLSET` +| `--platform` | `$PLATFORM` | `%PLATFORM%` | `$PLATFORM` +| `--configuration` | `$CONFIGURATION` | `%CONFIGURATION%` | `$CONFIGURATION` +| Boost version | `$BOOST_VERSION` | `%BOOST_VERSION%` | `$BOOST_VERSION` | Boost path | `$TRAVIS_BUILD_DIR/../build/boost` | `%APPVEYOR_BUILD_FOLDER%\..\build\boost` | `$GITHUB_WORKSPACE/../build/boost` | Build path | `$TRAVIS_BUILD_DIR/../build/cmake` | `%APPVEYOR_BUILD_FOLDER%\..\build\cmake` | `$GITHUB_WORKSPACE/../build/cmake` | Install path | `$TRAVIS_BUILD_DIR/../build/install` | `%APPVEYOR_BUILD_FOLDER%\..\build\install` | `$GITHUB_WORKSPACE/../build/install` diff --git a/project/ci/dirs.py b/project/ci/dirs.py index 6513455..b743380 100644 --- a/project/ci/dirs.py +++ b/project/ci/dirs.py @@ -40,17 +40,15 @@ class Dirs(abc.ABC): pass def get_toolset(self): - if 'toolset' in os.environ: - return ToolchainType.parse(os.environ['toolset']) + if 'TOOLSET' in os.environ: + return ToolchainType.parse(os.environ['TOOLSET']) return None - @abc.abstractmethod def get_platform(self): - pass + return Platform.parse(env('PLATFORM')) - @abc.abstractmethod def get_configuration(self): - pass + return Configuration.parse(env('CONFIGURATION')) @abc.abstractmethod def get_src_dir(self): @@ -64,7 +62,7 @@ class Dirs(abc.ABC): pass def get_boost_version(self): - return Version.from_string(env('boost_version')) + return Version.from_string(env('BOOST_VERSION')) def get_boost_dir(self): return os.path.join(self.get_build_dir(), 'boost') @@ -110,12 +108,6 @@ class Travis(Dirs): def this_one(self): return 'TRAVIS' in os.environ - def get_platform(self): - return Platform.parse(env('platform')) - - def get_configuration(self): - return Configuration.parse(env('configuration')) - def get_src_dir(self): return env('TRAVIS_BUILD_DIR') @@ -136,12 +128,6 @@ class AppVeyor(Dirs): def this_one(self): return 'APPVEYOR' in os.environ - def get_platform(self): - return Platform.parse(env('PLATFORM')) - - def get_configuration(self): - return Configuration.parse(env('CONFIGURATION')) - def get_src_dir(self): return env('APPVEYOR_BUILD_FOLDER') @@ -160,12 +146,6 @@ class GitHub(Dirs): def this_one(self): return 'GITHUB_ACTIONS' in os.environ - def get_platform(self): - return Platform.parse(env('platform')) - - def get_configuration(self): - return Configuration.parse(env('configuration')) - def get_src_dir(self): return env('GITHUB_WORKSPACE') -- cgit v1.2.3