Windows-MSys #461
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
# Copyright (c) 2022-2024, [Ribose Inc](https://www.ribose.com). | |
# All rights reserved. | |
# This file is a part of tamatebako | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions | |
# are met: | |
# 1. Redistributions of source code must retain the above copyright | |
# notice, this list of conditions and the following disclaimer. | |
# 2. Redistributions in binary form must reproduce the above copyright | |
# notice, this list of conditions and the following disclaimer in the | |
# documentation and/or other materials provided with the distribution. | |
# | |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS | |
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
# POSSIBILITY OF SUCH DAMAGE. | |
# | |
# The purpose of this workflow is to check that build procedures work correctly | |
# in specific environment. Due to this reason there is no caching. It is done by | |
# intention. All caching is in upstream projects. | |
# | |
# Also this file contains comments that will be useful is dwarfs has to be build | |
# in different environment, not GHA. | |
name: Windows-MSys | |
on: | |
schedule: | |
- cron: "0 5 * * 0" | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- 'docs/**' | |
- '**.adoc' | |
- '**.md' | |
- 'macos-arm64.env' | |
- 'macos-x86_64.env' | |
- '.cirrus.yml' | |
- '.github/workflows/*.yml' | |
- '!.github/workflows/windows-msys.yml' | |
# tags: [ v* ] | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '**.adoc' | |
- '**.md' | |
- '.cirrus.yml' | |
- 'macos-arm64.env' | |
- 'macos-x86_64.env' | |
- '.github/workflows/*.yml' | |
- '!.github/workflows/windows-msys.yml' | |
workflow_dispatch: | |
concurrency: | |
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' | |
cancel-in-progress: true | |
env: | |
CACHE_VER: 5 | |
jobs: | |
build: | |
name: windows-msys [ ${{ matrix.env.sys }} with Ruby mocks ] | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
env: | |
- { sys: ucrt64, LOG_LEVEL: 'warn', RB_W32: 'ON' } | |
env: ${{ matrix.env }} | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: Setup MSys | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{matrix.env.sys}} | |
path-type: minimal | |
update: true | |
install: >- | |
git | |
tar | |
bison | |
flex | |
pacboy: >- | |
toolchain:p | |
openssl:p | |
cmake:p | |
boost:p | |
make:p | |
diffutils:p | |
libevent:p | |
double-conversion:p | |
fmt:p | |
glog:p | |
dlfcn:p | |
ninja:p | |
gtest:p | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup environment | |
run: | | |
cat common.env >> $GITHUB_ENV | |
echo "CORES=$(nproc --all)" >> $GITHUB_ENV | |
- name: Create deps folder | |
run: mkdir ${{ env.DEPS }} | |
- name: Process cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{env.DEPS}} | |
key: windows-msys-${{ env.sys }}-${{ hashFiles('**/common.env') }}-v${{ env.CACHE_VER }} | |
- name: Configure | |
run: cmake -B build -DWITH_LINK_TESTS=OFF -DRB_W32=${{ env.RB_W32 }} -DTESTS_LOG_LEVEL=${{ env.LOG_LEVEL }} | |
- name: Build | |
run: cmake --build build --parallel "$CORES" | |
- name: Run unit tests | |
run: ctest --test-dir build --output-on-failure --parallel "$CORES" | |
- name: Checkout shell test framework | |
uses: actions/checkout@v4 | |
with: | |
repository: kward/shunit2 | |
path: tests/shunit2 | |
fetch-depth: 1 | |
- name: Run additional tests | |
run: tests/scripts/tests.sh | |
# - name: Pack | |
# run: cpack --config build/CPackConfig.cmake | |
# - name: Upload artifacts | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: libdwarfs-wr | |
# path: '*.7z' | |
# retention-days: 1 | |
publish: | |
name: Publish artifacts | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
if: contains(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: libdwarfs-wr | |
- name: Print release info | |
run: | | |
echo "Release version: ${{ github.ref }}" | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: '*.7z' | |
prerelease: ${{ contains(github.ref, '.rc') && 'true' || 'false' }} |