Skip to content

Fix ignore paths #1656

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

Merged
merged 5 commits into from
Apr 4, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
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
77 changes: 39 additions & 38 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@ 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 +55,34 @@ jobs:
# ghc: '8.6.4'

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need this step to skip unnecessary jobs started by outdated commits

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm does not the same action in the pre_job do all the needed work? Afaiu it does all the things and no depends on the params: https://github.com/fkirc/skip-duplicate-actions#usage-examples

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log of a build in my branch can provide some evidence:

Did not find other workflow-runs to be cancelled
Stop backtracking at commit https://github.com/jneira/haskell-language-server/commit/3eddabf804b4a09ea07cff26f5470514b1639f50 because '.github/workflows/test.yml' are not skippable against paths '' or paths_ignore '**/docs/**,**.md,**/LICENSE,.circleci/**,install/**,nix/**'
Do not skip execution because we did not find a transferable run

https://github.com/jneira/haskell-language-server/pull/22/checks?check_run_id=2256857741

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, does it work per workflow? I thought it's per job...


- 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 +96,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 +129,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 +139,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"