pre release 1.0.0 #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake Multi-Platform | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build-ubuntu: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
compiler: [gcc, clang] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up compiler | |
run: | | |
if [ "${{ matrix.compiler }}" == "gcc" ]; then | |
sudo apt-get update | |
sudo apt-get install -y g++ | |
elif [ "${{ matrix.compiler }}" == "clang" ]; then | |
sudo apt-get update | |
sudo apt-get install -y clang | |
fi | |
shell: bash | |
- name: Configure CMake | |
run: cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -B build | |
shell: bash | |
- name: Build with CMake | |
run: cmake --build build | |
shell: bash | |
- name: Install Library | |
run: cmake --install build --prefix ${{ github.workspace }}/mime_magic | |
shell: bash | |
- name: Upload Build Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-artifacts-ubuntu-${{ matrix.compiler }} | |
path: ${{ github.workspace }}/mime_magic | |
test-ubuntu: | |
runs-on: ubuntu-latest | |
needs: build-ubuntu | |
strategy: | |
matrix: | |
compiler: [gcc, clang] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-artifacts-ubuntu-${{ matrix.compiler }} | |
path: ${{ github.workspace }}/mime_magic | |
- name: Configure Tests | |
working-directory: ${{ github.workspace }}/tests | |
run: cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -B build | |
shell: bash | |
- name: Build Tests | |
working-directory: ${{ github.workspace }}/tests | |
run: cmake --build build | |
shell: bash | |
- name: Run Tests | |
working-directory: ${{ github.workspace }}/tests/build | |
run: ./tests | |
shell: bash | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up MSBuild | |
uses: microsoft/setup-msbuild@v1.1 | |
- name: Install Visual Studio Build Tools | |
run: | | |
choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --quiet --norestart" | |
shell: cmd | |
- name: Configure CMake | |
run: cmake -G "Visual Studio 16 2019" -B ${{ github.workspace }}/build | |
shell: cmd | |
- name: Build with CMake | |
run: cmake --build --config ${{ env.BUILD_TYPE }} | |
shell: cmd | |
- name: Install Library | |
run: cmake --install ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --prefix ${{ github.workspace }}/mime_magic | |
shell: cmd | |
- name: Upload Build Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-artifacts-windows | |
path: ${{ github.workspace }}/mime_magic | |
test-windows: | |
runs-on: windows-latest | |
needs: build-windows | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-artifacts-windows | |
path: ${{ github.workspace }}/mime_magic | |
- name: Configure Tests | |
working-directory: ${{ github.workspace }}/tests | |
run: cmake -B build | |
shell: cmd | |
- name: Build Tests | |
working-directory: ${{ github.workspace }}/tests | |
run: cmake --build build --config ${{ env.BUILD_TYPE }} | |
shell: cmd | |
- name: Run Tests | |
working-directory: ${{ github.workspace }}/tests/build | |
run: ./tests | |
shell: cmd | |
send_message: | |
runs-on: ubuntu-latest | |
needs: [test-ubuntu, test-windows] | |
steps: | |
- name: Send telegram message | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
message: | | |
mime_magic готов к слиянию | |
Выполнил: ${{ github.actor }} | |
Сообщение коммита: ${{ github.event.commits[0].message }} | |
Ссылка на коммит: https://github.com/${{ github.repository }}/commit/${{ github.sha }} |