Skip to content

Support flexdll 0.43/0.44 vendor-supplied patches #58

Support flexdll 0.43/0.44 vendor-supplied patches

Support flexdll 0.43/0.44 vendor-supplied patches #58

Workflow file for this run

##########################################################################
# File: dktool/cmake/scripts/dkml/workflow/compilers-github-workflows-dkml.in.yml#
# #
# Copyright 2022 Diskuv, Inc. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or #
# implied. See the License for the specific language governing #
# permissions and limitations under the License. #
# #
##########################################################################
# Updating
# --------
#
# 1. Delete this file.
# 2. Run dk with your original arguments:
# ./dk dkml.workflow.compilers PRERELEASE
# or get help to come up with new arguments:
# ./dk dkml.workflow.compilers HELP
name: Build with DkML compiler
env:
# Use the main branch of dkml-compiler because we are testing changes
# to [dkml-compiler]
DKML_COMPILER: "main"
# Use the main branch of [diskuv-opam-repository], so versions can
# be bumped by [dkml] project with bump-version.cmake (and
# diskuv-opam-repository bump-repository.cmake) without CI failing.
DISKUV_OPAM_REPOSITORY: "main"
PRIMARY_SWITCH_SKIP_INSTALL: "true"
# Use the main branch of dkml-runtime-common since dkml-compiler has
# a strict version constraint on dkml-runtime-common.
PIN_DKML_RUNTIME_COMMON: "main"
on:
# trigger on any push
push:
# ... or trigger manually from GitHub web interface
workflow_dispatch:
inputs:
apple-silicon:
type: boolean
default: false
description: "Turn on Apple Silicon job (not free)"
jobs:
build:
strategy:
matrix:
include:
- gh_os: windows-2019
abi_pattern: win32-windows_x86
dkml_host_abi: windows_x86
enabled: true
may_fail: false
- gh_os: windows-2019
abi_pattern: win32-windows_x86_64
dkml_host_abi: windows_x86_64
enabled: true
may_fail: false
- gh_os: ubuntu-latest
abi_pattern: manylinux2014-linux_x86
dkml_host_abi: linux_x86
enabled: true
may_fail: false
- gh_os: ubuntu-latest
abi_pattern: manylinux2014-linux_x86_64
dkml_host_abi: linux_x86_64
enabled: true
may_fail: false
- gh_os: macos-latest # Intel
abi_pattern: macos-darwin_all-intel
dkml_host_abi: darwin_x86_64
enabled: true
may_fail: false
# macos-13-xlarge is NOT FREE for Public projects as of 2023-11-25.
- gh_os: macos-13-xlarge # Apple Silicon. https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/
abi_pattern: macos-darwin_all-silicon
dkml_host_abi: darwin_arm64
enabled: ${{ inputs.apple-silicon }} # sadly we still incur a small cost because the machine has to launch
may_fail: true # this will fail to launch if there are no funds
runs-on: ${{ matrix.gh_os }}
name: build / ${{ matrix.abi_pattern }}
continue-on-error: ${{ matrix.may_fail }}
steps:
- name: Checkout code
if: matrix.enabled
uses: actions/checkout@v4
- name: Cache DkML compilers code
if: matrix.enabled
uses: actions/cache@v4
id: cache-dkml-compilers
with:
path: .ci/dkml-compilers
key: dkml-compilers-${{ runner.os }}
- name: Checkout DkML compilers code
if: steps.cache-dkml-compilers.outputs.cache-hit != 'true' && matrix.enabled
# For help: ./dk dkml.workflow.compilers HELP
run: ./dk dkml.workflow.compilers PRERELEASE CI GitHub
# The .ci/dkml-compilers "pre" actions will create the environment variables:
# opam_root, exe_ext, dkml_host_abi, abi_pattern (and many more)
#
- name: Setup DkML compilers on a Windows host
if: startsWith(matrix.dkml_host_abi, 'windows_') && matrix.enabled
uses: ./.ci/dkml-compilers/gh-windows/pre
with:
DKML_COMPILER: ${{ env.DKML_COMPILER }}
CACHE_PREFIX: ${{ env.CACHE_PREFIX }}
- name: Setup DkML compilers on a Linux host
if: startsWith(matrix.dkml_host_abi, 'linux_') && matrix.enabled
uses: ./.ci/dkml-compilers/gh-linux/pre
with:
DKML_COMPILER: ${{ env.DKML_COMPILER }}
CACHE_PREFIX: ${{ env.CACHE_PREFIX }}
- name: Setup DkML compilers on a Darwin host
if: startsWith(matrix.dkml_host_abi, 'darwin_') && matrix.enabled
uses: ./.ci/dkml-compilers/gh-darwin/pre
with:
DKML_COMPILER: ${{ env.DKML_COMPILER }}
CACHE_PREFIX: ${{ env.CACHE_PREFIX }}
# This section is for your own build logic which you should place in
# ci/build-test.sh or a similar file
- name: Build and test on Windows host
if: startsWith(matrix.dkml_host_abi, 'windows_') && matrix.enabled
shell: msys2 {0}
run: ci/build-test.sh
- name: Build and test on non-Windows host
if: |
!startsWith(matrix.dkml_host_abi, 'windows_') && matrix.enabled
run: sh ci/build-test.sh
# Capture the dist/ folder for the release job
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.dkml_host_abi }}
path: dist/
# The .ci/dkml-compilers "post" actions will finalize caching, etc.
- name: Teardown DkML compilers on a Windows host
if: startsWith(matrix.dkml_host_abi, 'windows_') && matrix.enabled
uses: ./.ci/dkml-compilers/gh-windows/post
- name: Teardown DkML compilers on a Darwin host
if: startsWith(matrix.dkml_host_abi, 'darwin_') && matrix.enabled
uses: ./.ci/dkml-compilers/gh-darwin/post
- name: Teardown DkML compilers on a Linux host
if: startsWith(matrix.dkml_host_abi, 'linux_') && matrix.enabled
uses: ./.ci/dkml-compilers/gh-linux/post
#--------
# Release
#--------
release:
runs-on: ubuntu-latest
permissions:
contents: write # Needed for softprops/action-gh-release@v1
# Wait until `build` complete
needs:
- build
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: dist
- name: Restructure multi-ABI directories
run: ci/prepare-release.sh
- name: Release (only when Git tag pushed)
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
_release/*