Skip to content

Commit

Permalink
Update GHA workflow version to 8
Browse files Browse the repository at this point in the history
More logic is now directly handled by bincrafters-package-tools which simplifies the GHA config file greatly
  • Loading branch information
Croydon committed Oct 27, 2020
1 parent 3a2dc5a commit 0bd1206
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 50 deletions.
31 changes: 6 additions & 25 deletions bincrafters_conventions/actions/update_gha.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# bincrafters-conventions:gha-workflow-version:7
# bincrafters-conventions:gha-workflow-version:8
# You can add custom environment variables above the version tag
# Do not modify the tag or anything below the tag
# This script gets automatically updated
Expand Down Expand Up @@ -47,32 +47,13 @@ jobs:
with:
python-version: "3.8"
- name: Install Conan
env:
BPT_MATRIX: ${{toJson(matrix.config)}}
run: |
pip install bincrafters_package_tools
conan user
echo "CONAN_${{ matrix.config.compiler }}_VERSIONS=${{ matrix.config.version }}" >> $GITHUB_ENV
echo "export CONAN_${{ matrix.config.compiler }}_VERSIONS=${{ matrix.config.version }}"
compiler="${{ matrix.config.compiler }}"
version="${{ matrix.config.version }}"
docker_image="${{ matrix.config.dockerImage }}"
if [[ "${compiler}" == "GCC" ]] || [[ "${compiler}" == "CLANG" ]]; then
if [[ "${docker_image}" == "" ]]; then
compiler_lower="${compiler,,}"
version_withoutdot="${version//./}"
docker_image="conanio/${compiler_lower}${version_withoutdot}"
fi
echo "CONAN_DOCKER_IMAGE=${docker_image}" >> $GITHUB_ENV
echo "export CONAN_DOCKER_IMAGE=${docker_image}"
fi
build_type="${{ matrix.config.buildType }}"
if ! [[ "${build_type}" == "" ]]; then
echo "CONAN_BUILD_TYPES=${build_type}" >> $GITHUB_ENV
echo "export CONAN_BUILD_TYPES=${build_type}"
fi
if [[ "${compiler}" == "APPLE_CLANG" ]] && [[ "${version}" == "11.0" ]]; then
sudo xcode-select -switch "/Applications/Xcode_11.3.1.app"
clang++ --version
fi
# remove newlines from matrix first
matrix=$(echo ${BPT_MATRIX})
bincrafters-package-tools prepare-env --platform gha --config "${matrix}"
shell: bash
- name: Run
env:
Expand Down
31 changes: 6 additions & 25 deletions tests/files/gha_1_expected.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ env:
splitByBuildTypes: "true"


# bincrafters-conventions:gha-workflow-version:7
# bincrafters-conventions:gha-workflow-version:8
# You can add custom environment variables above the version tag
# Do not modify the tag or anything below the tag
# This script gets automatically updated
Expand Down Expand Up @@ -51,32 +51,13 @@ jobs:
with:
python-version: "3.8"
- name: Install Conan
env:
BPT_MATRIX: ${{toJson(matrix.config)}}
run: |
pip install bincrafters_package_tools
conan user
echo "CONAN_${{ matrix.config.compiler }}_VERSIONS=${{ matrix.config.version }}" >> $GITHUB_ENV
echo "export CONAN_${{ matrix.config.compiler }}_VERSIONS=${{ matrix.config.version }}"
compiler="${{ matrix.config.compiler }}"
version="${{ matrix.config.version }}"
docker_image="${{ matrix.config.dockerImage }}"
if [[ "${compiler}" == "GCC" ]] || [[ "${compiler}" == "CLANG" ]]; then
if [[ "${docker_image}" == "" ]]; then
compiler_lower="${compiler,,}"
version_withoutdot="${version//./}"
docker_image="conanio/${compiler_lower}${version_withoutdot}"
fi
echo "CONAN_DOCKER_IMAGE=${docker_image}" >> $GITHUB_ENV
echo "export CONAN_DOCKER_IMAGE=${docker_image}"
fi
build_type="${{ matrix.config.buildType }}"
if ! [[ "${build_type}" == "" ]]; then
echo "CONAN_BUILD_TYPES=${build_type}" >> $GITHUB_ENV
echo "export CONAN_BUILD_TYPES=${build_type}"
fi
if [[ "${compiler}" == "APPLE_CLANG" ]] && [[ "${version}" == "11.0" ]]; then
sudo xcode-select -switch "/Applications/Xcode_11.3.1.app"
clang++ --version
fi
# remove newlines from matrix first
matrix=$(echo ${BPT_MATRIX})
bincrafters-package-tools prepare-env --platform gha --config "${matrix}"
shell: bash
- name: Run
env:
Expand Down

0 comments on commit 0bd1206

Please sign in to comment.