From df470c73c40fb5a3c00f23492b8d46f38810aa01 Mon Sep 17 00:00:00 2001 From: Jutho Date: Tue, 12 Sep 2023 22:23:36 +0200 Subject: [PATCH] update github actions --- .github/dependabot.yml | 7 ++++ .github/workflows/CI-nightly.yml | 1 + .../{format_check.yml => FormatCheck.yml} | 6 +-- .github/workflows/Invalidations.yml | 40 +++++++++++++++++++ .github/workflows/ci.yml | 2 +- 5 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 .github/dependabot.yml rename .github/workflows/{format_check.yml => FormatCheck.yml} (93%) create mode 100644 .github/workflows/Invalidations.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ff6499d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.github/workflows/CI-nightly.yml b/.github/workflows/CI-nightly.yml index 88c6ddd..6d67f46 100644 --- a/.github/workflows/CI-nightly.yml +++ b/.github/workflows/CI-nightly.yml @@ -3,6 +3,7 @@ on: push: branches: - main + - workflow_dispatch tags: ['*'] pull_request: concurrency: diff --git a/.github/workflows/format_check.yml b/.github/workflows/FormatCheck.yml similarity index 93% rename from .github/workflows/format_check.yml rename to .github/workflows/FormatCheck.yml index 14855d3..6c490e8 100644 --- a/.github/workflows/format_check.yml +++ b/.github/workflows/FormatCheck.yml @@ -13,7 +13,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - julia-version: [1] + julia-version: [1.3.0] julia-arch: [x86] os: [ubuntu-latest] steps: @@ -21,7 +21,7 @@ jobs: with: version: ${{ matrix.julia-version }} - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Install JuliaFormatter and format # This will use the latest version by default but you can set the version like so: # @@ -39,4 +39,4 @@ jobs: @error "Some files have not been formatted !!!" write(stdout, out) exit(1) - end' \ No newline at end of file + end' diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml new file mode 100644 index 0000000..1775a9c --- /dev/null +++ b/.github/workflows/Invalidations.yml @@ -0,0 +1,40 @@ +name: Invalidations + +on: + pull_request: + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: always. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + evaluate: + # 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@v1 + with: + version: '1' + - uses: actions/checkout@v4 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-invalidations@v1 + id: invs_pr + + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.repository.default_branch }} + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-invalidations@v1 + 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 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90ac9b1..db0f2b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: arch: - x64 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }}