Add CMake script and batch file to download Windows bison dependency #30
This file contains hidden or 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: CMake | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest, windows-latest ] | |
| # Disabled until <curses.h> can be safely included without conflict in terminal.h | |
| # os: [ ubuntu-latest, windows-latest, macos-latest ] | |
| runs-on: ${{matrix.os}} | |
| env: | |
| VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| submodules: true | |
| - uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
| core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
| - name: Download bison for Windows | |
| if: ${{matrix.os == 'windows-latest'}} | |
| shell: powershell | |
| env: | |
| BISON_ZIP_URL: http://user.xmission.com/~legalize/trn/bison-2.4.1.zip | |
| BISON_ZIP_PATH: ${{github.workspace}}/../bison-2.4.1.zip | |
| BISON_PATH: ${{github.workspace}}/../bison | |
| run: | | |
| Invoke-WebRequest -Uri ${{env.BISON_ZIP_URL}} -OutFile "${{env.BISON_ZIP_PATH}}" | |
| mkdir ${{env.BISON_PATH}} | |
| cd ${{env.BISON_PATH}} | |
| 7z x -y ${{env.BISON_ZIP_PATH}} | |
| Add-Content $env:GITHUB_PATH "${{env.BISON_PATH}}/bin" | |
| - name: CMake version | |
| run: cmake --version | |
| - name: CMake Linux workflow | |
| if: ${{matrix.os == 'ubuntu-latest'}} | |
| run: cmake --workflow --preset ci-linux | |
| - name: CMake workflow | |
| if: ${{matrix.os != 'ubuntu-latest'}} | |
| run: cmake --workflow --preset default |