Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: linting #2538

Merged
merged 5 commits into from
Dec 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ jobs:
uses: fkirc/[email protected]
with:
cancel_others: false
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "**.nix", "**/test/**", "flake.lock", "**/README.md", "FUNDING.yml", "**/stack*.yaml"]'
paths_ignore: '[ "**/docs/**"
, "**.md"
, "**/LICENSE"
, ".circleci/**"
, "install/**"
, "**.nix"
, "**/test/**"
, "flake.lock"
, "**/README.md"
, "FUNDING.yml"
, "**/stack*.yaml"
]'

bench_init:
if: needs.pre_job.outputs.should_skip != 'true'
Expand Down
46 changes: 29 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,17 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ['9.0.1', '8.10.7', '8.10.6', '8.8.4', '8.6.5']
os: [ubuntu-18.04, macOS-latest, windows-latest]
ghc:
[ "9.0.1"
, '8.10.7'
, "8.10.6"
, "8.8.4"
, "8.6.5"
]
os: [ "ubuntu-18.04"
, "macOS-latest"
, "windows-latest"
]
cabal: ['3.6']

steps:
Expand All @@ -44,7 +53,7 @@ jobs:
echo -e 'package blaze-textual\n flags: +integer-simple' >> cabal.project.local
fi

- name: Use modified cabal.project for ghc9
- name: (GHC 9.0) Use modified cabal.project for GHC 9.0
if: ${{ matrix.ghc == '9.0.1' }}
run: cp cabal-ghc901.project cabal.project

Expand All @@ -56,36 +65,36 @@ jobs:
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
src/**/*.hs exe/*.hs

- name: Set some window specific things
- name: (Windows) Platform specifics
if: matrix.os == 'windows-latest'
env:
GHC_VER: ${{ matrix.ghc }}
run: |
echo "EXE_EXT=.exe" >> $GITHUB_ENV
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV

- name: Set some linux specific things
- name: (Linux) Platform specifics
if: matrix.os == 'ubuntu-18.04'
env:
GHC_VER: ${{ matrix.ghc }}
run: |
echo "LINUX_CABAL_ARGS=--enable-executable-static --ghc-options=-split-sections" >> $GITHUB_ENV
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV

- name: Set some macOs specific things
- name: (macOS) Platform specifics
if: matrix.os == 'macOS-latest'
env:
GHC_VER: ${{ matrix.ghc }}
run: |
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV

- name: Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows
- name: (Windows, GHC 8.8.4) Workaround segfaults
if: matrix.ghc == '8.8.4' && matrix.os == 'windows-latest'
run: |
echo "package floskell" >> cabal.project
echo " ghc-options: -O0" >> cabal.project

- name: Build server
- name: Build the server
# Try building it twice in case of flakey builds on Windows
run: |
cabal build --disable-tests exe:hls -O2 $LINUX_CABAL_ARGS || \
Expand All @@ -109,7 +118,7 @@ jobs:
echo ::set-output name=extension::gz
fi

- name: Upload server to release
- name: (not check) Upload server to release
if: ${{ !contains(github.ref_name, 'check') }}
uses: actions/[email protected]
env:
Expand All @@ -126,11 +135,11 @@ jobs:
name: haskell-language-server-${{ runner.OS }}-${{ matrix.ghc }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }}
path: ${{ steps.compress_server_binary.outputs.path }}

- name: Build wrapper
- name: (GHC 8.10) Build the wrapper
if: matrix.ghc == '8.10.7'
run: cabal build --disable-tests exe:hls-wrapper -O2 $LINUX_CABAL_ARGS

- name: Compress wrapper binary
- name: (GHC 8.10) Compress wrapper binary
if: matrix.ghc == '8.10.7'
id: compress_wrapper_binary
run: |
Expand All @@ -149,7 +158,7 @@ jobs:
echo ::set-output name=extension::gz
fi

- name: Upload wrapper to the release
- name: (GHC 8.10, not check) Upload wrapper to the release
if: ${{ matrix.ghc == '8.10.7' && !contains(github.ref_name, 'check') }}
uses: actions/[email protected]
env:
Expand All @@ -160,7 +169,7 @@ jobs:
asset_name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }}
asset_content_type: ${{ steps.compress_wrapper_binary.outputs.content_type}}

- name: Upload wrapper to workflow artifacts
- name: (GHC 8.10) Upload wrapper to workflow artifacts
uses: actions/upload-artifact@v2
if: matrix.ghc == '8.10.7'
with:
Expand All @@ -183,7 +192,7 @@ jobs:
-o src-dist/haskell-language-server.tar.gz \
HEAD

- name: Upload source tarball to the release
- name: (not check) Upload source tarball to the release
if: ${{ !contains(github.ref_name, 'check') }}
uses: actions/[email protected]
env:
Expand All @@ -207,7 +216,10 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
os: [Linux, macOS, Windows]
os: [ "Linux"
, "macOS"
, "Windows"
]
steps:
- uses: actions/download-artifact@v2

Expand All @@ -227,7 +239,7 @@ jobs:
fi
tar -czpf haskell-language-server.tar.gz *

- name: Upload binaries tarball to the release
- name: (not check) Upload binaries tarball to the release
if: ${{ !contains(github.ref_name, 'check') }}
uses: actions/[email protected]
env:
Expand Down Expand Up @@ -256,7 +268,7 @@ jobs:
# we clean up tags to match the release file names
sed -i 's/\/.*)/)/g' SHA256SUMS

- name: Upload sha256sums to the release
- name: (not check) Upload sha256sums to the release
if: ${{ !contains(github.ref_name, 'check') }}
uses: actions/[email protected]
env:
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/caching.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,16 @@ jobs:
uses: fkirc/[email protected]
with:
cancel_others: false
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", "install/**", "**.nix", "flake.lock", "**/README.md", "FUNDING.yml", ".circleci/**"]'
paths_ignore: '["**/docs/**"
, "**.md"
, "**/LICENSE"
, "install/**"
, "**.nix"
, "flake.lock"
, "**/README.md"
, "FUNDING.yml"
, ".circleci/**"
]'

caching:
if: needs.pre_job.outputs.should_skip != 'true'
Expand All @@ -67,8 +76,16 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ["9.0.1", '8.10.7', '8.10.6', "8.8.4", "8.6.5"]
os: [ubuntu-latest, macOS-latest, windows-latest]
ghc: [ "9.0.1"
, "8.10.7"
, "8.10.6"
, "8.8.4"
, "8.6.5"
]
os: [ "ubuntu-latest"
, "macOS-latest"
, "windows-latest"
]
cabal: ['3.6']

steps:
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,20 @@ jobs:
uses: fkirc/[email protected]
with:
cancel_others: false
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "**/README.md", "FUNDING.yml", "**/stack*.yaml"]'
paths_ignore: '[ "**/docs/**"
, "**.md"
, "**/LICENSE"
, ".circleci/**"
, "install/**"
, "**/README.md"
, "FUNDING.yml"
, "**/stack*.yaml"
]'
- id: skip_check_no_nix
uses: fkirc/[email protected]
with:
cancel_others: false
paths: '["**.nix"]'
paths: '[ "**.nix" ]'

# Enter the development shell and run `cabal build`
develop:
Expand Down
33 changes: 28 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,29 @@ jobs:
uses: fkirc/[email protected]
with:
cancel_others: false
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", "install/**", "**.nix", "flake.lock", "**/README.md", "FUNDING.yml", ".circleci/**", "**/stack*.yaml"]'
paths_ignore: '[ "**/docs/**"
, "**.md"
, "**/LICENSE"
, "install/**"
, "**.nix"
, "flake.lock"
, "**/README.md"
, "FUNDING.yml"
, ".circleci/**"
, "**/stack*.yaml"
]'
# If we only change ghcide downstream packages we have not test ghcide itself
- id: skip_ghcide_check
uses: fkirc/[email protected]
with:
cancel_others: false
paths_ignore: '["hls-test-utils/**", "plugins/**", "src/**", "exe/**", "test/**", "shake-bench/**"]'
paths_ignore: '[ "hls-test-utils/**"
, "plugins/**"
, "src/**"
, "exe/**"
, "test/**"
, "shake-bench/**"
]'

test:
if: needs.pre_job.outputs.should_skip != 'true'
Expand All @@ -40,8 +56,15 @@ jobs:
strategy:
fail-fast: true
matrix:
ghc: ["9.0.1", '8.10.7', '8.10.6', "8.8.4", "8.6.5"]
os: [ubuntu-latest, macOS-latest]
ghc: [ "9.0.1"
, "8.10.7"
, "8.10.6"
, "8.8.4"
, "8.6.5"
]
os: [ "ubuntu-latest"
, "macOS-latest"
]
cabal: ['3.6']
include:
# only test supported ghc major versions
Expand Down Expand Up @@ -93,7 +116,7 @@ jobs:

# Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file
- if: matrix.ghc == '9.0.1'
name: (GHC 9.0.1) Use modified `cabal.project`
name: (GHC 9.0) Use modified `cabal.project`
run: |
# File has some protections preventing regular `rm`.
# (most probably sticky bit is set on $HOME)
Expand Down