From 399425e360719ef33162cf05790600aab5566cc0 Mon Sep 17 00:00:00 2001 From: Lukas <37111893+lkdvos@users.noreply.github.com> Date: Fri, 17 May 2024 10:10:38 +0200 Subject: [PATCH] Rework github actions (#30) * update CI * simplify formatcheck * update doc action * Rename github actions * Add dependabot --- .github/dependabot.yml | 7 ++++ .github/workflows/{ci.yml => CI.yml} | 12 ++++--- .github/workflows/CompatHelper.yml | 18 ++++++++++ .../workflows/{docs.yml => Documentation.yml} | 1 + .../{formatter.yml => FormatCheck.yml} | 24 ++----------- .github/workflows/TagBot.yml | 34 +++++++++++++++++++ 6 files changed, 69 insertions(+), 27 deletions(-) create mode 100644 .github/dependabot.yml rename .github/workflows/{ci.yml => CI.yml} (85%) create mode 100644 .github/workflows/CompatHelper.yml rename .github/workflows/{docs.yml => Documentation.yml} (97%) rename .github/workflows/{formatter.yml => FormatCheck.yml} (60%) create mode 100644 .github/workflows/TagBot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..ff6499d6 --- /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.yml b/.github/workflows/CI.yml similarity index 85% rename from .github/workflows/ci.yml rename to .github/workflows/CI.yml index 17148087..98ab7c37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/CI.yml @@ -31,17 +31,19 @@ jobs: - x64 steps: - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v1 + - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest env: JULIA_NUM_THREADS: 4 - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: file: lcov.info test-nightly: @@ -61,11 +63,11 @@ jobs: - x64 steps: - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v1 + - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest env: diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml new file mode 100644 index 00000000..e2fbe0dd --- /dev/null +++ b/.github/workflows/CompatHelper.yml @@ -0,0 +1,18 @@ +name: CompatHelper + +on: + schedule: + - cron: 0 0 * * * + workflow_dispatch: + +jobs: + CompatHelper: + runs-on: ubuntu-latest + steps: + - name: Pkg.add("CompatHelper") + run: julia -e 'using Pkg; Pkg.add("CompatHelper")' + - name: CompatHelper.main() + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} + run: julia -e 'using CompatHelper; CompatHelper.main()' \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/Documentation.yml similarity index 97% rename from .github/workflows/docs.yml rename to .github/workflows/Documentation.yml index f3269903..63d3eb4d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/Documentation.yml @@ -8,6 +8,7 @@ on: - 'release-' tags: '*' pull_request: + workflow_dispatch: jobs: build: diff --git a/.github/workflows/formatter.yml b/.github/workflows/FormatCheck.yml similarity index 60% rename from .github/workflows/formatter.yml rename to .github/workflows/FormatCheck.yml index a57dbf68..1f0d0515 100644 --- a/.github/workflows/formatter.yml +++ b/.github/workflows/FormatCheck.yml @@ -1,4 +1,4 @@ -name: format-check +name: FormatCheck on: push: @@ -35,7 +35,6 @@ jobs: julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))' julia -e 'using JuliaFormatter; format(".", verbose=true)' - name: Format check - id: format run: | julia -e ' out = Cmd(`git diff --name-only`) |> read |> String @@ -45,23 +44,4 @@ jobs: @error "Some files have not been formatted !!!" write(stdout, out) exit(1) - end' - - - name: Create pull request - if: ${{ failure() && steps.format.conclusion == 'failure' }} - id: cpr - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Format .jl files - title: 'Automatic JuliaFormatter.jl run' - base: ${{ github.head_ref }} - branch: auto-juliaformatter-pr - delete-branch: true - labels: formatting, automated pr, no changelog - - - name: Check outputs - if: ${{ success() && steps.cpr.conclusion == 'success' }} - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" + end' \ No newline at end of file diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml new file mode 100644 index 00000000..c466a764 --- /dev/null +++ b/.github/workflows/TagBot.yml @@ -0,0 +1,34 @@ +name: TagBot + +on: + issue_comment: + types: + - created + workflow_dispatch: + inputs: + lookback: + default: 3 + +permissions: + actions: read + checks: read + contents: write + deployments: read + issues: read + discussions: read + packages: read + pages: read + pull-requests: read + repository-projects: read + security-events: read + statuses: read + +jobs: + TagBot: + if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' + runs-on: ubuntu-latest + steps: + - uses: JuliaRegistries/TagBot@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ssh: ${{ secrets.DOCUMENTER_KEY }} \ No newline at end of file