0.8.0.1 #27
Workflow file for this run
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 binaries | |
| on: | |
| release: | |
| types: [published] | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| system: x86_64-linux | |
| attr: native | |
| - os: macOS-latest | |
| system: aarch64-darwin | |
| attr: native | |
| - os: macOS-latest | |
| system: x86_64-darwin | |
| attr: native | |
| # Because of | |
| # https://github.com/input-output-hk/haskell.nix/issues/2228, we build | |
| # (outside of Nix) with a non-cross GHC for Windows for now. | |
| # - os: ubuntu-latest | |
| # system: x86_64-linux | |
| # attr: windows | |
| name: Build ${{ matrix.attr }} binary on ${{ matrix.system }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/install-nix-action@v31 | |
| with: | |
| extra_nix_config: | | |
| accept-flake-config = true | |
| - name: Get target system | |
| id: system | |
| run: | | |
| ( echo -n "SYSTEM=" | |
| nix eval -L --system ${{ matrix.system }} .#binaries/${{ matrix.attr }} \ | |
| --apply 'd: d.stdenv.hostPlatform.system' | |
| echo ) >> "$GITHUB_OUTPUT" | |
| - name: Build binary | |
| run: | | |
| nix build -L --system ${{ matrix.system }} .#binaries/${{ matrix.attr }} | |
| - name: Prepare upload | |
| run: | | |
| nix profile install --inputs-from . nixpkgs#p7zip | |
| cd result/bin | |
| 7z a -l ${{ github.workspace }}/ormolu.zip . | |
| - uses: shogo82148/actions-upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ormolu.zip | |
| asset_name: ormolu-${{ steps.system.outputs.SYSTEM }}.zip | |
| build-windows: | |
| name: Build Windows binary | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: '9.10' | |
| - name: Build binary | |
| run: cabal build exe:ormolu | |
| env: | |
| ORMOLU_REV: ${{ github.sha }} | |
| - name: Prepare upload | |
| run: | | |
| mkdir result | |
| cp $(cabal list-bin exe:ormolu) result | |
| cd result | |
| 7z a ../ormolu.zip . | |
| - uses: shogo82148/actions-upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ormolu.zip | |
| asset_name: ormolu-x86_64-windows.zip | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| system: x86_64-linux | |
| - os: macOS-latest | |
| system: aarch64-darwin | |
| - os: macOS-latest | |
| system: x86_64-darwin | |
| - os: windows-latest | |
| system: x86_64-windows | |
| name: Test built binaries | |
| runs-on: ${{ matrix.os }} | |
| needs: [build, build-windows] | |
| steps: | |
| - name: Download and extract binary | |
| run: | | |
| curl -sL https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/ormolu-${{ matrix.system }}.zip > ormolu.zip | |
| 7z e ormolu.zip | |
| - name: Basic functionality tests | |
| run: | | |
| ./ormolu --version | |
| echo "data A = A" > test.hs | |
| ./ormolu -m check test.hs |