Fix using lsp not taking effect in CI #46
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: Compile WASM | |
| on: | |
| push: | |
| branches: [wasm, wasm-*] | |
| tags: | |
| - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
| pull_request: | |
| branches: [wasm, wasm-*] | |
| env: | |
| GHC_WASM_META_FLAVOUR: '9.10' | |
| GHC_WASM_META_COMMIT_HASH: 'c3f44696d29aaeadd755d69c51735954bfcd59db' | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| agda: | |
| # undocumented usage; see https://stackoverflow.com/q/66025220 | |
| - { name: '2.8.0', flag: '2-8-0', commit: 'e2f8c69414fa115328280ecc4de1d2b7a23be7fa' } | |
| - { name: '2.7.0', flag: '2-7-0', commit: '702c924fdab93aa8992adca84e72a91c490f7b1b' } | |
| - { name: '2.6.4.3', flag: '2-6-4', commit: '8f35851954c39dc3849095bfd018bed9bd1b32ad' } | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| path: als | |
| submodules: recursive | |
| - name: Checkout Agda submodule at v${{ matrix.agda.name }} | |
| run: | | |
| cd als/wasm-submodules/agda | |
| git fetch --depth 1 origin "${{ matrix.agda.commit }}" | |
| git checkout FETCH_HEAD | |
| - name: Compute cache key | |
| run: echo "CI_CACHE_KEY=${{ runner.os }}-${{ runner.arch }}-${{ env.GHC_WASM_META_COMMIT_HASH }}-flavor-${{ env.GHC_WASM_META_FLAVOUR }}" >> "$GITHUB_ENV" | |
| - name: Try to restore cached .ghc-wasm | |
| id: ghc-wasm-cache-restore | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ~/.ghc-wasm | |
| key: ghc-wasm-${{ env.CI_CACHE_KEY }} | |
| - name: Try to restore cached native cabal | |
| id: native-cabal-cache-restore | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| ~/.config/cabal | |
| ~/.cache/cabal | |
| key: native-cabal-${{ env.CI_CACHE_KEY }} | |
| - name: Try to restore cached dist-newstyle | |
| id: dist-newstyle-cache-restore | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: als/dist-newstyle | |
| key: dist-newstyle-${{ env.CI_CACHE_KEY }}-${{ hashFiles('als/dist-newstyle/**') }} | |
| restore-keys: | | |
| dist-newstyle-${{ env.CI_CACHE_KEY }}- | |
| - name: Clone and setup ghc-wasm-meta | |
| id: ghc-wasm-setup | |
| if: steps.ghc-wasm-cache-restore.outputs.cache-matched-key == '' | |
| run: | | |
| mkdir ghc-wasm-meta | |
| cd ghc-wasm-meta | |
| git config --global init.defaultBranch dontcare | |
| git config --global advice.detachedHead false | |
| git init | |
| git remote add origin https://gitlab.haskell.org/haskell-wasm/ghc-wasm-meta.git | |
| git fetch origin ${{ env.GHC_WASM_META_COMMIT_HASH }} --depth=1 | |
| git checkout FETCH_HEAD | |
| FLAVOUR=${{ env.GHC_WASM_META_FLAVOUR }} ./setup.sh | |
| - name: Add ghc-wasm-meta to PATH | |
| run: ~/.ghc-wasm/add_to_github_path.sh | |
| # setup script also updates package store near the end | |
| - name: Update wasm32 cabal | |
| if: steps.ghc-wasm-setup.outcome == 'success' || steps.ghc-wasm-setup.outcome == 'skipped' | |
| run: wasm32-wasi-cabal update | |
| - name: Install native utilities | |
| run: | | |
| echo ">>> Update cabal" | |
| ~/.ghc-wasm/cabal/bin/cabal update | |
| echo ">>> Install alex and happy" | |
| ~/.ghc-wasm/cabal/bin/cabal install alex-3.5.0.0 happy-1.20.1.1 | |
| - name: Cabal configure | |
| working-directory: './als' | |
| run: | | |
| mv cabal.project.wasm32 cabal.project | |
| wasm32-wasi-cabal configure --flag=Agda-${{ matrix.agda.flag }} | |
| - name: Build Agda as dependency | |
| id: build-dep-agda | |
| working-directory: './als' | |
| run: wasm32-wasi-cabal build lib:agda | |
| - name: Cache dist-newstyle | |
| uses: actions/cache/save@v4 | |
| if: steps.build-dep-agda.outcome == 'success' | |
| with: | |
| path: als/dist-newstyle | |
| key: dist-newstyle-${{ env.CI_CACHE_KEY }}-${{ hashFiles('als/dist-newstyle/**') }} | |
| - name: Build dependencies other than Agda | |
| working-directory: './als' | |
| run: | | |
| # Setup network submodule autotools | |
| cd wasm-submodules/network | |
| autoreconf -i | |
| cd ../.. | |
| # Build all dependencies (cabal git deps + network submodule) | |
| wasm32-wasi-cabal build --dependencies-only | |
| - name: Build als | |
| working-directory: './als' | |
| run: | | |
| mkdir ~/out | |
| wasm32-wasi-cabal build | |
| ALS_PATH=$(wasm32-wasi-cabal list-bin als) | |
| stat --format="%s" "$ALS_PATH" | |
| time wasm-opt "$ALS_PATH" -Oz -o ~/out/als.wasm | |
| stat --format="%s" ~/out/als.wasm | |
| - name: Clean up native/wasm cabal logs | |
| run: rm -rf ~/.cache/cabal/logs ~/.ghc-wasm/.cabal/logs | |
| - name: Cache native cabal | |
| uses: actions/cache/save@v4 | |
| if: steps.ghc-wasm-setup.outcome == 'success' | |
| with: | |
| path: | | |
| ~/.config/cabal | |
| ~/.cache/cabal | |
| key: ${{ steps.native-cabal-cache-restore.outputs.cache-primary-key }} | |
| - name: Cache ghc-wasm-meta | |
| uses: actions/cache/save@v4 | |
| if: steps.ghc-wasm-setup.outcome == 'success' | |
| with: | |
| path: ~/.ghc-wasm | |
| key: ${{ steps.ghc-wasm-cache-restore.outputs.cache-primary-key }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: als | |
| path: ~/out | |
| include-hidden-files: true |