Fix hd-view package-qualified imports bypassing home-unit #807
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
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: {} | |
| workflow_call: | |
| inputs: | |
| use-haskell-debugger-view-from-hackage: | |
| required: true | |
| type: boolean | |
| is-release: | |
| required: true | |
| type: boolean | |
| env: | |
| haskellDebuggerViewVersion: 0.2.1.0 | |
| haskellDebuggerVersion: 0.12.3.0 | |
| USE_HASKELL_DEBUGGER_VIEW_FROM_HACKAGE: ${{ | |
| github.event_name == 'workflow_call' | |
| && inputs.use-haskell-debugger-view-from-hackage | |
| || false | |
| }} | |
| name: Debugger CI | |
| jobs: | |
| build-vscode-extension: | |
| name: Build VSCode Extension | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: cachix/install-nix-action@v31 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - name: Build extension | |
| run: | | |
| cd vscode-extension/ | |
| nix-build | |
| - name: Upload extension artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Haskell Debugger Extension | |
| path: vscode-extension/result/haskell-debugger-extension*.vsix | |
| sdist-haskell-debugger: | |
| name: Sdist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: haskell-actions/setup@v2 | |
| - name: Package hdb | |
| run: cabal sdist | |
| - name: Package haskell-debugger-view | |
| run: cabal sdist haskell-debugger-view | |
| - name: Upload haskell-debugger source distribution | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Haskell Debugger Source Distribution | |
| # This will catch both haskell-debugger and haskell-debugger-view | |
| path: dist-newstyle/sdist/haskell-debugger*.tar.gz | |
| # Tests run on the distributed sdist to catch packaging issues. | |
| build-n-test-haskell-debugger: | |
| name: Build and Run Tests on Sdist | |
| needs: sdist-haskell-debugger | |
| runs-on: ubuntu-latest # just one is fine here, we test more machines on the checkout | |
| continue-on-error: ${{ inputs.is-release == false }} | |
| strategy: | |
| matrix: | |
| version: [9.14.1] | |
| include: | |
| - channel: https://raw.githubusercontent.com/haskell/ghcup-metadata/refs/heads/develop/ghcup-prereleases-0.0.9.yaml | |
| version: 9.14.1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cabal/store | |
| key: ${{ runner.os }}-integration-ghc-${{ matrix.version }}-cabal-${{ hashFiles('**/*.cabal', 'cabal.project*') }} | |
| restore-keys: | | |
| ${{ runner.os }}-integration-ghc-${{ matrix.version }}-cabal- | |
| - uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: ${{ matrix.version }} | |
| cabal-version: 3.16 | |
| ghcup-release-channel: ${{ matrix.channel }} | |
| - name: Download hdb source dist | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Haskell Debugger Source Distribution | |
| path: ${{ runner.temp }}/dist | |
| - name: Untar haskell-debugger | |
| run: | | |
| (cd ${{ runner.temp }}/dist && tar xzf "haskell-debugger-${{env.haskellDebuggerVersion}}.tar.gz") | |
| - name: Setup local version of haskell-debugger-view | |
| if: env.USE_HASKELL_DEBUGGER_VIEW_FROM_HACKAGE | |
| run: | | |
| (cd ${{ runner.temp }}/dist && tar xzf "haskell-debugger-view-${{env.haskellDebuggerViewVersion}}.tar.gz" && mv "haskell-debugger-view-${{env.haskellDebuggerViewVersion}}" "haskell-debugger-${{env.haskellDebuggerVersion}}/haskell-debugger-view") | |
| (cd ${{ runner.temp }}/dist/haskell-debugger-${{env.haskellDebuggerVersion}} && echo 'packages: . ./haskell-debugger-view' > cabal.project) | |
| - name: Build and Run tests | |
| run: | | |
| echo "Using haskell-debugger-view from hackage: ${{env.USE_HASKELL_DEBUGGER_VIEW_FROM_HACKAGE}}" | |
| cd ${{ runner.temp }}/dist/haskell-debugger-${{env.haskellDebuggerVersion}} | |
| cabal run haskell-debugger-test --enable-executable-dynamic --allow-newer=ghc-bignum,containers,time,ghc,base,template-haskell --ghc-options=-Werror | |
| # Tests run on the git checkout | |
| build-n-more-test-haskell-debugger: | |
| name: Build and Run Tests on checkout (${{ matrix.runner }}) | |
| runs-on: ${{ matrix.runner }} | |
| # Run all jobs in the matrix to the end (IF RELEASE, STOP ON FAILURE) | |
| continue-on-error: ${{ inputs.is-release == false }} | |
| strategy: | |
| matrix: | |
| runner: [ubuntu-latest, macOS-latest] # windows-latest is broken, see #246 | |
| version: [9.14.1] #, latest-nightly] disable nightly while its broken | |
| include: | |
| # - channel: https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml | |
| # version: latest-nightly | |
| - channel: https://raw.githubusercontent.com/haskell/ghcup-metadata/refs/heads/develop/ghcup-prereleases-0.0.9.yaml | |
| version: 9.14.1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: "Cache GHC for macOS" # See haskell-actions/setup#139 | |
| id: cache-haskell | |
| uses: actions/cache@v5 | |
| if: matrix.runner == 'macOS-latest' | |
| with: | |
| path: ~/.ghcup | |
| key: ${{ runner.os }}-ghc-${{ matrix.version }} | |
| restore-keys: ${{ runner.os }}-ghc-${{ matrix.version }} | |
| - uses: haskell-actions/setup@v2 | |
| id: setup | |
| with: | |
| ghc-version: ${{ matrix.version }} | |
| cabal-version: 3.16 | |
| ghcup-release-channel: ${{ matrix.channel }} | |
| - name: Configure the build | |
| run: | | |
| cabal configure --enable-tests --enable-benchmarks --disable-documentation | |
| cabal build all --dry-run | |
| # The last step generates dist-newstyle/cache/plan.json for the cache key. | |
| - name: Restore cached dependencies | |
| uses: actions/cache/restore@v4 | |
| id: cache | |
| env: | |
| key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }} | |
| with: | |
| path: ${{ steps.setup.outputs.cabal-store }} | |
| key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} | |
| restore-keys: ${{ env.key }}- | |
| - name: Install dependencies | |
| # If we had an exact cache hit, the dependencies will be up to date. | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: cabal build all --only-dependencies | |
| # Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail. | |
| - name: Save cached dependencies | |
| uses: actions/cache/save@v4 | |
| # If we had an exact cache hit, trying to save the cache would error because of key clash. | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| with: | |
| path: ${{ steps.setup.outputs.cabal-store }} | |
| key: ${{ steps.cache.outputs.cache-primary-key }} | |
| - name: Build and Run Haskell tests | |
| shell: bash | |
| run: | | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| cabal run haskell-debugger-test --allow-newer=ghc-bignum,containers,time,ghc,base,template-haskell | |
| else | |
| cabal run haskell-debugger-test --enable-executable-dynamic --allow-newer=ghc-bignum,containers,time,ghc,base,template-haskell | |
| fi |