diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..cb0251d --- /dev/null +++ b/.github/dependabot.yml @@ -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" diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2991d66..93f2c8d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -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: @@ -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 " 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 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1321c59..f7e8751 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -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. @@ -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 @@ -64,4 +64,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/BUILDING.MD b/BUILDING.MD index 13faa07..736e5af 100755 --- a/BUILDING.MD +++ b/BUILDING.MD @@ -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 ``` diff --git a/README.TXT b/README.TXT index b839764..f87f34b 100644 --- a/README.TXT +++ b/README.TXT @@ -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. -