From d1330ddbcccfa2cd565960c86d037828385bc214 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Wed, 29 Nov 2023 12:16:10 -0500 Subject: [PATCH] Add some workflows --- .github/workflows/FormatCheck.yml | 16 ++++-------- .github/workflows/VersionVigilante.yml | 34 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/VersionVigilante.yml diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index dd551501c..d56bde19a 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -29,14 +29,8 @@ jobs: run: | julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))' julia -e 'using JuliaFormatter; format(".", verbose=true)' - - name: Format check - run: | - julia -e ' - out = Cmd(`git diff --name-only`) |> read |> String - if out == "" - exit(0) - else - @error "Some files have not been formatted !!!" - write(stdout, out) - exit(1) - end' + - uses: reviewdog/action-suggester@v1 + with: + tool_name: JuliaFormatter + fail_on_error: true + filter_mode: added \ No newline at end of file diff --git a/.github/workflows/VersionVigilante.yml b/.github/workflows/VersionVigilante.yml new file mode 100644 index 000000000..5881ece82 --- /dev/null +++ b/.github/workflows/VersionVigilante.yml @@ -0,0 +1,34 @@ +name: VersionVigilante + +on: pull_request + +jobs: + VersionVigilante: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@latest + - name: VersionVigilante.main + id: versionvigilante_main + run: | + using Pkg + Pkg.add("VersionVigilante") + using VersionVigilante + VersionVigilante.main("https://github.com/${{ github.repository }}", master_branch="main") + shell: julia {0} + - name: ✅ Un-Labeller (if success) + if: (steps.versionvigilante_main.outputs.compare_versions == 'success') && (success() || failure()) + continue-on-error: true + uses: actions/github-script@v6.4.1 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.issues.removeLabel({...context.issue, name: 'needs version bump'}) + - name: ❌ Labeller (if failure) + if: (steps.versionvigilante_main.outputs.compare_versions == 'failure') && (success() || failure()) + continue-on-error: true + uses: actions/github-script@v6.4.1 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.issues.addLabels({...context.issue, labels: ['needs version bump']}) \ No newline at end of file