test: add unit tests for core functionality #74
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: 'Build' | |
on: | |
push: | |
branches: '**' | |
tags: 'v[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
branches: 'main' | |
# workflow_dispatch: | |
# inputs: | |
# verbose_build: | |
# description: 'verbose build process' | |
# type: boolean | |
# required: true | |
# default: false | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: 'Build & Test' | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-22.04 | |
- ubuntu-20.04 | |
- macos-12 | |
- macos-11 | |
dc: | |
- dmd-latest | |
- ldc-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dlang-community/setup-dlang@v1 | |
with: | |
compiler: ${{ matrix.dc }} | |
- name: 'dub build/lint/test' | |
run: | | |
dub_configuration=application | |
if [[ -x /usr/bin/xcodebuild ]]; then | |
/usr/bin/xcodebuild -version | |
xcode_version="$(/usr/bin/xcodebuild -version | awk '/Xcode/ { print int($2) }')" | |
if [[ $xcode_version -eq 15 ]]; then | |
dub_configuration="application-xcode$xcode_version" | |
else | |
dub_configuration="application-xcode-older" | |
fi | |
fi | |
# if [[ "${{ inputs.verbose_build }}" = "true" ]]; then | |
# uname -a | |
# $DC --version | |
# fi | |
dub build --compiler=$DC --build=release-debug --config=$dub_configuration # --verbose | |
dub lint --compiler=$DC --config=$dub_configuration # --verbose | |
dub test --compiler=$DC --config=$dub_configuration # --verbose | |
- name: 'Upload binary' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: myrc-${{ matrix.os }}-${{ matrix.dc }} | |
path: myrc | |
start-release: | |
name: 'Schedule release' | |
needs: [build] | |
if: ${{ github.ref_type == 'tag' }} | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- run: gh workflow run release.yml -f version=MYTAG | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |