Skip to content

Commit

Permalink
More GH Action work (#25)
Browse files Browse the repository at this point in the history
* try to upload each binary built

* codeql v2

* allow manually dispatching of the build
  • Loading branch information
danlangford committed Sep 29, 2022
1 parent 6b7448e commit 91f15ef
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 15 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Set update schedule for GitHub Actions

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "weekly"
57 changes: 47 additions & 10 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
name: CMake

on: [push, pull_request]
on:
push:
pull_request:

# this allows us to manually dispatch the build from GH Actions UI
workflow_dispatch:
inputs:
buildType:
description: CMake build type (config)
required: true
default: 'Release'
type: choice
options:
- Release
- Debug

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
# if the build is not manually dispatched we will default to 'Release' build
BUILD_TYPE: ${{ inputs.buildType || 'Release' }}

jobs:
build:
Expand All @@ -17,29 +31,52 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Get latest CMake and ninja
uses: lukka/get-cmake@latest
- uses: lukka/get-cmake@latest

- name: CMake Configure
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{runner.workspace}}
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake -S $GITHUB_WORKSPACE -B build
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=$BUILD_TYPE

- name: CMake Build
working-directory: ${{runner.workspace}}
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build build --config $BUILD_TYPE



# NOTICE current error is

# Run ctest -C $BUILD_TYPE
# env:
# BUILD_TYPE: Release
# Test project /home/runner/work/bmai/bmai/build
# No tests were found!!!

# maybe we havent written tests and I just put this in here to follow some template?
# TODO add some tests, or fix the problem running them

- name: Test
working-directory: ${{runner.workspace}}/build
working-directory: build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE

- name: Upload *NIX Binary
uses: actions/upload-artifact@v3
if: matrix.os != 'windows-latest'
with:
name: bmai-${{runner.os}}
path: ./build/bmai

- name: Upload WINDOWS Binary
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: bmai-${{runner.os}}
path: ${{github.workspace}}\build\${{ env.BUILD_TYPE }}\bmai.exe
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -50,7 +50,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -64,4 +64,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion BUILDING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ echo or build from command line
cmake --build build --config Debug
echo for a subsequent Release build you will need to rebuild the build/ dir
cmake -S . -B build
echo --build build --config Release
cmake --build build --config Release
```
1 change: 0 additions & 1 deletion README.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,3 @@ f) You will not use the source code (or modified source code) to have an
AI player play other players (whether online through a BM web site or
through other means), without posting a notice or otherwise
indicating that the player is an AI.

0 comments on commit 91f15ef

Please sign in to comment.