From a659148b6846ffa9674bd87af7d5620ce2f09a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= <765740+giordano@users.noreply.github.com> Date: Mon, 9 Dec 2024 00:34:26 +0000 Subject: [PATCH] [CI] Some updates to GitHub Actions setup (#583) * Install dependabot * Update various external workflows * Use `julia-actions/setup-julia` instead of `actions/cache` --- .github/dependabot.yml | 7 +++++++ .github/workflows/ci_integration.yml | 19 +++++------------- .github/workflows/ci_unit.yml | 29 ++++++++++++++-------------- .github/workflows/format_pr.yml | 6 +++++- 4 files changed, 31 insertions(+), 30 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..700707ce --- /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" diff --git a/.github/workflows/ci_integration.yml b/.github/workflows/ci_integration.yml index 4e686a90..c6226279 100644 --- a/.github/workflows/ci_integration.yml +++ b/.github/workflows/ci_integration.yml @@ -33,21 +33,12 @@ jobs: name: Integration runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 with: version: '1' arch: x64 - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - run: git config --global user.email "noreply@example.com" - run: git config --global user.name "GitHub Actions" @@ -58,7 +49,7 @@ jobs: BCBI_TEST_USER_GITHUB_TOKEN: ${{ secrets.BCBI_TEST_USER_GITHUB_TOKEN }} INTEGRATION_TEST_READ_ONLY_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v5 with: - file: lcov.info + files: lcov.info token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/ci_unit.yml b/.github/workflows/ci_unit.yml index ce4d0082..eb6ae56b 100644 --- a/.github/workflows/ci_unit.yml +++ b/.github/workflows/ci_unit.yml @@ -1,4 +1,5 @@ name: CI (unit tests) + on: merge_group: # GitHub Merge Queue pull_request: @@ -6,9 +7,12 @@ on: branches: - master tags: '*' + env: JULIA_PKG_UNPACK_REGISTRY: 'true' + jobs: + unit: name: Unit/Julia ${{ matrix.version }}/${{ matrix.os }}/${{ matrix.arch }} runs-on: ${{ matrix.os }} @@ -29,35 +33,28 @@ jobs: - '1' - 'nightly' steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 env: AUTOMERGE_RUN_INTEGRATION_TESTS: "false" + documentation: env: JULIA_PKG_UNPACK_REGISTRY: 'false' name: Documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: '1' + - uses: julia-actions/cache@v2 - run: | julia --project=docs -e ' using Pkg @@ -70,14 +67,16 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + doctests: name: Doctests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 with: version: '1' + - uses: julia-actions/cache@v2 - run: | julia --project=docs -e ' using Pkg diff --git a/.github/workflows/format_pr.yml b/.github/workflows/format_pr.yml index 31c00b09..a3e7b270 100644 --- a/.github/workflows/format_pr.yml +++ b/.github/workflows/format_pr.yml @@ -1,14 +1,18 @@ name: Code Formatting + on: push: branches: - master workflow_dispatch: + jobs: format_pr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 + - uses: julia-actions/cache@v2 - name: Install the JuliaFormatter package run: julia --color=yes -e 'using Pkg; Pkg.add(name = "JuliaFormatter", uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899")' - name: Precompile dependencies