From cc670c6af86aeca2f27c7bb089b528eb3da4d25b Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Thu, 25 Jul 2024 05:09:04 -0400 Subject: [PATCH 01/11] Add the `package_name` input --- action.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index aa7ca73..f7221c1 100644 --- a/action.yml +++ b/action.yml @@ -6,6 +6,10 @@ inputs: description: 'Script to test for invalidations. Defaults to `using Package`' required: false default: '' + package_name: + description: 'Name of the package. By default, tries to auto-detect from the repo name.' + required: false + default: '' outputs: total: @@ -22,7 +26,12 @@ runs: id: info run: | REPONAME="${{ github.event.repository.name }}" - PACKAGENAME=${REPONAME%.jl} + if [[ '${{ inputs.package_name }}' == '' ]]; then + PACKAGENAME=${REPONAME%.jl} + else + PACKAGENAME="" + PACKAGENAME="${{ inputs.package_name }}" + fi echo "packagename=$PACKAGENAME" >> $GITHUB_OUTPUT if [[ '${{ inputs.test_script }}' == '' ]]; then TESTSCRIPT="using ${PACKAGENAME}" From 1782fac85abf0a46d47688cc96369f835e5b87ed Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Thu, 25 Jul 2024 04:35:52 -0400 Subject: [PATCH 02/11] Add some CI to this repo --- .github/workflows/Invalidations.yml | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/Invalidations.yml diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml new file mode 100644 index 0000000..2948bcb --- /dev/null +++ b/.github/workflows/Invalidations.yml @@ -0,0 +1,46 @@ +name: Example + +on: + pull_request: + +defaults: + run: + working-directory: ./ci/ + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: always. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + example: + # Only run on PRs to the default branch. + # In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch + # if: github.base_ref == github.event.repository.default_branch + runs-on: ubuntu-latest + steps: + - uses: julia-actions/setup-julia@v2 + with: + version: '1' + - uses: actions/checkout@v3 + - uses: julia-actions/julia-buildpkg@v1 + # - uses: julia-actions/julia-invalidations@v1 + - uses: ../../ + id: invs_pr + + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.repository.default_branch }} + - uses: julia-actions/julia-buildpkg@v1 + # - uses: julia-actions/julia-invalidations@v1 + - uses: ../../ + id: invs_default + + - name: Report invalidation counts + run: | + echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY + echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY + - name: Check if the PR does increase number of invalidations + if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total + run: exit 1 From 077d43d1f5c4afb2e348e9e1f0dbf4ef8e05612d Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Thu, 25 Jul 2024 04:37:04 -0400 Subject: [PATCH 03/11] Update Invalidations.yml --- .github/workflows/Invalidations.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml index 2948bcb..1854352 100644 --- a/.github/workflows/Invalidations.yml +++ b/.github/workflows/Invalidations.yml @@ -5,7 +5,7 @@ on: defaults: run: - working-directory: ./ci/ + # working-directory: ./ci/ concurrency: # Skip intermediate builds: always. @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v3 - uses: julia-actions/julia-buildpkg@v1 # - uses: julia-actions/julia-invalidations@v1 - - uses: ../../ + - uses: ./ id: invs_pr - uses: actions/checkout@v3 @@ -34,7 +34,7 @@ jobs: ref: ${{ github.event.repository.default_branch }} - uses: julia-actions/julia-buildpkg@v1 # - uses: julia-actions/julia-invalidations@v1 - - uses: ../../ + - uses: ./ id: invs_default - name: Report invalidation counts From 3b2fc7921ac7bbb979cd5194ca8ffcfb882f811e Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Thu, 25 Jul 2024 04:38:07 -0400 Subject: [PATCH 04/11] Update Invalidations.yml --- .github/workflows/Invalidations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml index 1854352..f564e12 100644 --- a/.github/workflows/Invalidations.yml +++ b/.github/workflows/Invalidations.yml @@ -3,8 +3,8 @@ name: Example on: pull_request: -defaults: - run: +# defaults: + # run: # working-directory: ./ci/ concurrency: From 7814c04449fb4b72c16d902b60d51da527955117 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Thu, 25 Jul 2024 04:41:35 -0400 Subject: [PATCH 05/11] Update Invalidations.yml --- .github/workflows/Invalidations.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml index f564e12..2fd531b 100644 --- a/.github/workflows/Invalidations.yml +++ b/.github/workflows/Invalidations.yml @@ -28,6 +28,8 @@ jobs: # - uses: julia-actions/julia-invalidations@v1 - uses: ./ id: invs_pr + with: + test_script: 'import Example' - uses: actions/checkout@v3 with: @@ -36,6 +38,8 @@ jobs: # - uses: julia-actions/julia-invalidations@v1 - uses: ./ id: invs_default + with: + test_script: 'import Example' - name: Report invalidation counts run: | From 97c5fe49be9c427a3686dfc5c3e2fab0b3855d83 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Thu, 25 Jul 2024 04:50:39 -0400 Subject: [PATCH 06/11] Update Invalidations.yml --- .github/workflows/Invalidations.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml index 2fd531b..2b9f830 100644 --- a/.github/workflows/Invalidations.yml +++ b/.github/workflows/Invalidations.yml @@ -24,10 +24,14 @@ jobs: with: version: '1' - uses: actions/checkout@v3 - - uses: julia-actions/julia-buildpkg@v1 + - run: | + import Pkg + p = Pkg.PackageSpec(name = "Example", version = "0.5", uuid = "7876af07-990d-54b4-ab0e-23690620f79a") + Pkg.add(p) + shell: julia {0} # - uses: julia-actions/julia-invalidations@v1 - uses: ./ - id: invs_pr + id: invs_pro with: test_script: 'import Example' From cf0537bc6111b6019f318c3726db9015117a7ba2 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Thu, 25 Jul 2024 05:00:01 -0400 Subject: [PATCH 07/11] Update Invalidations.yml --- .github/workflows/Invalidations.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml index 2b9f830..c75089e 100644 --- a/.github/workflows/Invalidations.yml +++ b/.github/workflows/Invalidations.yml @@ -34,6 +34,7 @@ jobs: id: invs_pro with: test_script: 'import Example' + package_name: 'Example' - uses: actions/checkout@v3 with: @@ -44,6 +45,7 @@ jobs: id: invs_default with: test_script: 'import Example' + package_name: 'Example' - name: Report invalidation counts run: | From 53c64234ed5138a9939e9e2888c9145c67189f6f Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Thu, 25 Jul 2024 05:05:06 -0400 Subject: [PATCH 08/11] Update Invalidations.yml --- .github/workflows/Invalidations.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml index c75089e..1a5cbef 100644 --- a/.github/workflows/Invalidations.yml +++ b/.github/workflows/Invalidations.yml @@ -36,10 +36,6 @@ jobs: test_script: 'import Example' package_name: 'Example' - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.repository.default_branch }} - - uses: julia-actions/julia-buildpkg@v1 # - uses: julia-actions/julia-invalidations@v1 - uses: ./ id: invs_default From 1da972615d67f76a056f81d177d23da0aa1d5853 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Thu, 25 Jul 2024 05:15:09 -0400 Subject: [PATCH 09/11] Remove a redundant line --- action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/action.yml b/action.yml index f7221c1..5a45db7 100644 --- a/action.yml +++ b/action.yml @@ -29,7 +29,6 @@ runs: if [[ '${{ inputs.package_name }}' == '' ]]; then PACKAGENAME=${REPONAME%.jl} else - PACKAGENAME="" PACKAGENAME="${{ inputs.package_name }}" fi echo "packagename=$PACKAGENAME" >> $GITHUB_OUTPUT From 5744f5067bc625d745ab6b6f8f1f50502c043604 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Thu, 25 Jul 2024 05:09:04 -0400 Subject: [PATCH 10/11] Add the `package_name` input --- action.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index aa7ca73..f7221c1 100644 --- a/action.yml +++ b/action.yml @@ -6,6 +6,10 @@ inputs: description: 'Script to test for invalidations. Defaults to `using Package`' required: false default: '' + package_name: + description: 'Name of the package. By default, tries to auto-detect from the repo name.' + required: false + default: '' outputs: total: @@ -22,7 +26,12 @@ runs: id: info run: | REPONAME="${{ github.event.repository.name }}" - PACKAGENAME=${REPONAME%.jl} + if [[ '${{ inputs.package_name }}' == '' ]]; then + PACKAGENAME=${REPONAME%.jl} + else + PACKAGENAME="" + PACKAGENAME="${{ inputs.package_name }}" + fi echo "packagename=$PACKAGENAME" >> $GITHUB_OUTPUT if [[ '${{ inputs.test_script }}' == '' ]]; then TESTSCRIPT="using ${PACKAGENAME}" From bcba6c1b5f6c7e590069e83e11b7a27c48aa8bbe Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Thu, 25 Jul 2024 05:15:09 -0400 Subject: [PATCH 11/11] Remove a redundant line --- action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/action.yml b/action.yml index f7221c1..5a45db7 100644 --- a/action.yml +++ b/action.yml @@ -29,7 +29,6 @@ runs: if [[ '${{ inputs.package_name }}' == '' ]]; then PACKAGENAME=${REPONAME%.jl} else - PACKAGENAME="" PACKAGENAME="${{ inputs.package_name }}" fi echo "packagename=$PACKAGENAME" >> $GITHUB_OUTPUT