Files
libloot-python/.github/workflows/ci.yml
T
Oliver Hamlet 64293324c3 Stop uploading snapshot artifacts to Artifactory
The JFrog account that's used by the LOOT organisation will be
deactivated on 2023-07-02 because JFrog are sunsetting their free
accounts.
2023-06-05 17:34:29 +01:00

89 lines
2.4 KiB
YAML

name: CI
on:
push:
# Don't run this workflow when a tag is pushed.
branches:
- '*'
pull_request:
env:
MSVC_CONFIG: RelWithDebInfo
jobs:
windows:
runs-on: windows-2019
strategy:
matrix:
platform: [Win32, x64]
python-version: [3.7]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get Python architecture
id: get-python-architecture
shell: bash
run: |
if [[ "${{ matrix.platform }}" == "Win32" ]]
then
PLATFORM=x86
else
PLATFORM=x64
fi
echo "::set-output name=architecture::$PLATFORM"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ steps.get-python-architecture.outputs.architecture }}
- name: Get descriptive version
id: get-version
shell: bash
run: |
GIT_DESCRIBE=$(git describe --tags --long --abbrev=7)
DESC_REF=${GIT_DESCRIBE}_${GITHUB_REF#refs/*/}
SAFE_DESC_REF=${DESC_REF//[\/<>\"|]/_}
echo "::set-output name=version::$SAFE_DESC_REF"
- name: Run CMake
run: |
mkdir build
cd build
cmake .. -G "Visual Studio 16 2019" -A ${{ matrix.platform }} -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.version }}-python${{ matrix.python-version }}"
cmake --build . --config ${{ env.MSVC_CONFIG }}
- name: Run tests
run: |
cd build
ctest -C ${{ env.MSVC_CONFIG }}
- name: Build archive
id: build-archive
shell: bash
run: |
cd build
cpack -C ${{ env.MSVC_CONFIG }}
VERSION="${{ steps.get-version.outputs.version }}-python${{ matrix.python-version }}"
if [[ "${{ matrix.platform }}" == "Win32" ]]
then
PLATFORM=win32
else
PLATFORM=win64
fi
echo "::set-output name=filename::libloot-python-${VERSION}-${PLATFORM}.zip"
- name: Upload archive
uses: actions/upload-artifact@v2
with:
name: ${{ steps.build-archive.outputs.filename }}
path: build/package/${{ steps.build-archive.outputs.filename }}
if: github.event_name == 'push'