run JuliaFormatter on schedule
This commit is contained in:
parent
214663aa4b
commit
35fd604e07
11
.github/workflows/format.yml
vendored
11
.github/workflows/format.yml
vendored
@ -5,7 +5,8 @@ on:
|
||||
|
||||
jobs:
|
||||
JuliaFormatter:
|
||||
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||
if: false
|
||||
# if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@ -13,14 +14,10 @@ jobs:
|
||||
with:
|
||||
version: 1
|
||||
|
||||
# Setup
|
||||
- name: Ubuntu TESTCMD
|
||||
run: echo "TESTCMD=xvfb-run --auto-servernum julia" >> $GITHUB_ENV
|
||||
|
||||
# Check format
|
||||
- name: Install JuliaFormatter and format
|
||||
run: |
|
||||
git diff --name-only --exit-code
|
||||
$TESTCMD -e 'using Pkg; pkg"add JuliaFormatter CSTParser#master"'
|
||||
$TESTCMD -e 'using JuliaFormatter; format(["src", "test"])'
|
||||
julia -e 'using Pkg; pkg"add JuliaFormatter CSTParser#master"'
|
||||
julia -e 'using JuliaFormatter; [format(["src", "test"]) for _ in 1:2]'
|
||||
git diff --exit-code
|
||||
|
||||
35
.github/workflows/format_pr.yml
vendored
Normal file
35
.github/workflows/format_pr.yml
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
name: format-pr
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * SUN'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install JuliaFormatter and format
|
||||
run: |
|
||||
julia -e 'import Pkg; pkg"add JuliaFormatter CSTParser#master"'
|
||||
julia -e 'using JuliaFormatter; [format(["src", "test"]) for _ in 1:2]'
|
||||
git diff --exit-code
|
||||
|
||||
- name: Create Pull Request
|
||||
if: ${{ failure() }}
|
||||
id: cpr
|
||||
uses: peter-evans/create-pull-request@v3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: "Format .jl files [skip ci]"
|
||||
title: 'Automatic JuliaFormatter.jl run'
|
||||
branch: auto-juliaformatter-pr
|
||||
delete-branch: true
|
||||
labels: formatting, automated pr, no changelog
|
||||
|
||||
- name: Check outputs
|
||||
if: ${{ failure() }}
|
||||
run: |
|
||||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
||||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
||||
Loading…
x
Reference in New Issue
Block a user