Fix parser: handle multi-line and edge case parsing #68
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| env: | |
| CGO_ENABLED: "1" | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - run: go test ./... | |
| test-race: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - run: go test -race ./... | |
| test-integration: | |
| runs-on: ubuntu-latest | |
| container: elixir:1.19 | |
| env: | |
| GOMODCACHE: ${{ github.workspace }}/.gomod | |
| MIX_HOME: ${{ github.workspace }}/.mix | |
| HEX_HOME: ${{ github.workspace }}/.hex | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: .go/ | |
| key: go-install-${{ hashFiles('go.sum') }} | |
| restore-keys: go-install- | |
| - uses: actions/cache@v4 | |
| with: | |
| path: .gomod/ | |
| key: go-mod-integration-${{ hashFiles('go.sum') }} | |
| restore-keys: go-mod-integration- | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .mix/ | |
| .hex/ | |
| internal/lsp/testdata/monorepo/apps/app_with_styler/deps/ | |
| internal/lsp/testdata/monorepo/apps/app_with_styler/_build/ | |
| internal/lsp/testdata/monorepo/apps/app_with_ecto_migration/deps/ | |
| internal/lsp/testdata/monorepo/apps/app_with_ecto_migration/_build/ | |
| key: elixir-deps-${{ hashFiles('internal/lsp/testdata/monorepo/apps/app_with_styler/mix.lock', 'internal/lsp/testdata/monorepo/apps/app_with_ecto_migration/mix.lock') }} | |
| restore-keys: elixir-deps- | |
| - name: Install Go | |
| run: | | |
| if [ ! -f .go/bin/go ]; then | |
| mkdir -p .go | |
| curl -fsSL https://go.dev/dl/go1.26.1.linux-amd64.tar.gz | tar -C .go --strip-components=1 -xz | |
| fi | |
| echo "$GITHUB_WORKSPACE/.go/bin" >> "$GITHUB_PATH" | |
| - name: Install Elixir dependencies | |
| run: | | |
| mix local.hex --force && mix local.rebar --force | |
| cd internal/lsp/testdata/monorepo/apps/app_with_styler && mix deps.get && mix deps.compile && cd - | |
| cd internal/lsp/testdata/monorepo/apps/app_with_ecto_migration && mix deps.get && mix deps.compile && cd - | |
| cd internal/lsp/testdata/monorepo/apps/app_basic && mix deps.get && cd - | |
| - name: Run integration tests | |
| run: go test ./internal/lsp/ -run 'TestFormatterServer_(WithStyler|BasicProject|BadIndentation|CacheInvalidation|DifferentProjects|MigrationDSL)' -v -timeout 120s | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: v2.11.4 | |
| - run: go mod tidy && git diff --exit-code go.mod go.sum |