Skip to content

Commit

Permalink
Fix ignore paths (#1656)
Browse files Browse the repository at this point in the history
* Skip individual steps

* Skip individual steps

* And needs pre_job
  • Loading branch information
jneira authored Apr 4, 2021
1 parent 7971a37 commit fc5a412
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 67 deletions.
72 changes: 42 additions & 30 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ jobs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
uses: fkirc/skip-duplicate-actions@v3.4.0
with:
cancel_others: true
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "nix/**", "**/test/**"]'

bench-init:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -29,18 +28,19 @@ jobs:
os: [ubuntu-latest]

steps:
# Cancel queued workflows from earlier commits in this branch
- uses: fkirc/skip-duplicate-actions@master

- uses: actions/checkout@v2
- run: git fetch origin master # check the master branch for benchmarking
- uses: haskell/actions/setup@v1
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/checkout@v2
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: git fetch origin master # check the master branch for benchmarking
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.2'
enable-stack: false

- name: Cache Cabal
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Cache Cabal
uses: actions/cache@v2
with:
path: |
Expand All @@ -52,46 +52,53 @@ jobs:
v2-${{ runner.os }}-${{ matrix.ghc }}-bench-
v2-${{ runner.os }}-${{ matrix.ghc }}
- run: cabal update
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: cabal update

- run: cabal configure --enable-benchmarks
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: cabal configure --enable-benchmarks

- name: Build
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Build
shell: bash
run: cabal build ghcide:benchHist

- name: Bench init
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Bench init
shell: bash
run: cabal bench ghcide:benchHist -j --benchmark-options="all-binaries"

# tar is required to preserve file permissions
# compression speeds up upload/download nicely
- name: tar workspace
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: tar workspace
shell: bash
run: tar -czf workspace.tar.gz * .git

- name: tar cabal
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: tar cabal
run: |
cd ~/.cabal
tar -czf cabal.tar.gz *
- name: Upload workspace
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Upload workspace
uses: actions/upload-artifact@v2
with:
name: workspace
retention-days: 1
path: workspace.tar.gz

- name: Upload .cabal
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Upload .cabal
uses: actions/upload-artifact@v2
with:
name: cabal-home
retention-days: 1
path: ~/.cabal/cabal.tar.gz

bench-example:
needs: [pre_job, bench-init]
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
needs: [bench-init, pre_job]
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -102,42 +109,46 @@ jobs:
example: ['Cabal-3.0.0.0', 'lsp-types-1.0.0.1']

steps:
# Cancel queued workflows from earlier commits in this branch
- uses: fkirc/skip-duplicate-actions@master

- uses: haskell/actions/setup@v1
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.2'
enable-stack: false

- name: Download cabal home
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Download cabal home
uses: actions/download-artifact@v2
with:
name: cabal-home
path: .

- name: Download workspace
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Download workspace
uses: actions/download-artifact@v2
with:
name: workspace
path: .

- name: untar
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: untar
run: |
tar xzf workspace.tar.gz
tar xzf cabal.tar.gz --directory ~/.cabal
- name: Bench
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Bench
shell: bash
run: cabal bench ghcide:benchHist -j --benchmark-options="${{ matrix.example }}"

- name: Display results
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Display results
shell: bash
run: |
column -s, -t < ghcide/bench-results/unprofiled/${{ matrix.example }}/results.csv | tee ghcide/bench-results/unprofiled/${{ matrix.example }}/results.txt
- name: Archive benchmarking artifacts
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Archive benchmarking artifacts
uses: actions/upload-artifact@v2
with:
name: bench-results-${{ runner.os }}-${{ matrix.ghc }}
Expand All @@ -147,7 +158,8 @@ jobs:
ghcide/bench-results/**/*.svg
ghcide/bench-results/**/*.eventlog.html
- name: Archive benchmark logs
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Archive benchmark logs
uses: actions/upload-artifact@v2
with:
name: bench-logs-${{ runner.os }}-${{ matrix.ghc }}
Expand Down
76 changes: 39 additions & 37 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ jobs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
uses: fkirc/skip-duplicate-actions@v3.4.0
with:
cancel_others: true
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "nix/**"]'


test:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
Expand Down Expand Up @@ -58,33 +56,34 @@ jobs:
# ghc: '8.6.4'

steps:
# Cancel queued workflows from earlier commits in this branch
- uses: fkirc/skip-duplicate-actions@master

- uses: actions/checkout@v2
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/checkout@v2
with:
submodules: true
- uses: haskell/actions/setup@v1
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: "3.2"

- run: ./fmt.sh
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: ./fmt.sh
name: "HLint via ./fmt.sh"

- name: Set some window specific things
if: matrix.os == 'windows-latest'
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.os == 'windows-latest'}}
name: Set some window specific things
run: |
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
- name: Set some linux/macOS specific things
if: matrix.os != 'windows-latest'
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.os != 'windows-latest'}}
name: Set some linux/macOS specific things
run: |
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
- name: Cache Cabal
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Cache Cabal
uses: actions/cache@v2
env:
cache-name: cache-cabal
Expand All @@ -98,28 +97,31 @@ jobs:
v2-${{ runner.os }}-${{ matrix.ghc }}-build-
v2-${{ runner.os }}-${{ matrix.ghc }}
- run: cabal update
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: cabal update

# Need this to work around filepath length limits in Windows
- name: Shorten binary names
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Shorten binary names
run: |
sed -i.bak -e 's/haskell-language-server/hls/g' \
-e 's/haskell_language_server/hls/g' \
haskell-language-server.cabal
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
src/**/*.hs exe/*.hs
- name: Build
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Build
# Retry it three times to workaround compiler segfaults in windows
run: cabal build || cabal build || cabal build

- name: Test ghcide
if: ${{ matrix.test }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
name: Test ghcide
# run the tests without parallelism to avoid running out of memory
run: cabal test ghcide --test-options="-j1 --rerun-update" || cabal test ghcide --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test ghcide --test-options="-j1 --rerun"

- name: Test func-test suite
if: ${{ matrix.test }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
name: Test func-test suite
env:
HLS_TEST_EXE: hls
HLS_WRAPPER_TEST_EXE: hls-wrapper
Expand All @@ -128,8 +130,8 @@ jobs:
# instances to be spun up for the poor github actions runner to handle
run: cabal test func-test --test-options="-j1 --rerun --rerun-update" || cabal test func-test --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test func-test --test-options="-j1 --rerun"

- name: Test wrapper-test suite
if: ${{ matrix.test }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
name: Test wrapper-test suite
env:
HLS_TEST_EXE: hls
HLS_WRAPPER_TEST_EXE: hls-wrapper
Expand All @@ -138,30 +140,30 @@ jobs:
# instances to be spun up for the poor github actions runner to handle
run: cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1"

- name: Test hls-brittany-plugin
if: ${{ matrix.test }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
name: Test hls-brittany-plugin
run: cabal test hls-brittany-plugin || cabal test hls-brittany-plugin --test-options="-j1"

- name: Test hls-class-plugin
if: ${{ matrix.test }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
name: Test hls-class-plugin
run: cabal test hls-class-plugin || cabal test hls-class-plugin --test-options="-j1"

- name: Test hls-eval-plugin
if: ${{ matrix.test }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
name: Test hls-eval-plugin
run: cabal test hls-eval-plugin --test-options="-j1 --rerun" || cabal test hls-eval-plugin --test-options="-j1 --rerun"

- name: Test hls-haddock-comments-plugin
if: ${{ matrix.test }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
name: Test hls-haddock-comments-plugin
run: cabal test hls-haddock-comments-plugin || cabal test hls-haddock-comments-plugin --test-options="-j1"

- name: Test hls-splice-plugin
if: ${{ matrix.test }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
name: Test hls-splice-plugin
run: cabal test hls-splice-plugin || cabal test hls-splice-plugin --test-options="-j1"

- name: Test hls-stylish-haskell-plugin
if: ${{ matrix.test }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
name: Test hls-stylish-haskell-plugin
run: cabal test hls-stylish-haskell-plugin || cabal test hls-stylish-haskell-plugin --test-options="-j1"

- name: Test hls-tactics-plugin test suite
if: ${{ matrix.test }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
name: Test hls-tactics-plugin test suite
run: LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-tactics-plugin --test-options="-j1"

0 comments on commit fc5a412

Please sign in to comment.