Add optimization flag for Windows builds in Makefile #14
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: Build and Test | |
| on: | |
| push: | |
| branches: [main, master] | |
| paths-ignore: | |
| - "**.md" | |
| - "screenshots/**" | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| build-test: | |
| name: Build & Test (${{ matrix.name }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Linux-x64 | |
| os: ubuntu-latest | |
| asset_pattern: "qb64pe_lnx-*.tar.gz" | |
| bin_name: Brainfuck64 | |
| - name: Windows-x64 | |
| os: windows-latest | |
| asset_pattern: "qb64pe_win-x64-*.7z" | |
| bin_name: Brainfuck64.exe | |
| - name: Windows-arm64 | |
| os: windows-11-arm | |
| asset_pattern: "qb64pe_win-arm64-*.7z" | |
| bin_name: Brainfuck64.exe | |
| - name: macOS-arm64 | |
| os: macos-latest | |
| asset_pattern: "qb64pe_osx-*.tar.gz" | |
| bin_name: Brainfuck64 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Download QB64-PE | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release download -R QB64-Phoenix-Edition/QB64pe -p "${{ matrix.asset_pattern }}" --dir qb64_dl | |
| - name: Extract & Setup QB64-PE (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| mkdir qb64_src | |
| tar -xzf qb64_dl/*.tar.gz -C qb64_src | |
| SETUP_PATH=$(find qb64_src -name "setup_lnx.sh" -o -name "setup_osx.command" | head -n 1) | |
| if [ -z "$SETUP_PATH" ]; then | |
| echo "Error: Setup script not found in tarball." | |
| ls -R qb64_src | |
| exit 1 | |
| fi | |
| SETUP_DIR=$(dirname "$SETUP_PATH") | |
| cd "$SETUP_DIR" | |
| if [[ "${{ runner.os }}" == "Linux" ]]; then | |
| sudo apt-get update | |
| chmod +x setup_lnx.sh | |
| ./setup_lnx.sh 1 | |
| else | |
| chmod +x setup_osx.command | |
| ./setup_osx.command 1 | |
| fi | |
| echo "QB64PE_BIN_DIR=$(pwd)" >> $GITHUB_ENV | |
| - name: Extract QB64-PE (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| 7z x qb64_dl/*.7z -oqb64_src | |
| $subFolder = Get-ChildItem -Path qb64_src -Directory | Select-Object -First 1 | |
| if ($subFolder) { | |
| Move-Item -Path "$($subFolder.FullName)\*" -Destination qb64_src\ | |
| } | |
| echo "QB64PE_BIN_DIR=$((Get-Item qb64_src).FullName)" >> $env:GITHUB_ENV | |
| - name: Build and Test | |
| shell: bash | |
| run: | | |
| if [[ "${{ runner.os }}" == "Windows" ]]; then | |
| export QB64PE_PATH=$(pwd -W)/qb64_src | |
| mingw32-make test | |
| else | |
| export QB64PE_PATH="${{ env.QB64PE_BIN_DIR }}" | |
| make test | |
| fi | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }}-bin | |
| path: ${{ matrix.bin_name }} | |
| if-no-files-found: error |