From 9b64dd89dcde2dc0d8845cd01b4cc305ea83086e Mon Sep 17 00:00:00 2001 From: Philipp Gabler Date: Thu, 3 Feb 2022 22:41:38 +0000 Subject: [PATCH] Setup `bors` (#42) Implements #30. Is there anything else to set up for bors? Co-authored-by: Hong Ge Co-authored-by: David Widmann --- .github/workflows/CI.yml | 6 ++++- .github/workflows/Format.yml | 38 +++++++++++++++++++++++++++ .github/workflows/IntegrationTest.yml | 6 ++++- bors.toml | 18 +++++++++++++ 4 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/Format.yml create mode 100644 bors.toml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7771b4d..c70076d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,8 +3,12 @@ name: CI on: push: branches: + # This is where pull requests from "bors r+" are built. + - staging + # This is where pull requests from "bors try" are built. + - trying + # Build the main branch. - main - pull_request: jobs: test: diff --git a/.github/workflows/Format.yml b/.github/workflows/Format.yml new file mode 100644 index 0000000..9d8e17d --- /dev/null +++ b/.github/workflows/Format.yml @@ -0,0 +1,38 @@ +name: Format + +on: + push: + branches: + # This is where pull requests from "bors r+" are built. + - staging + # This is where pull requests from "bors try" are built. + - trying + # Build the main branch. + - main + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + version: 1 + - name: Format code + run: | + using Pkg + Pkg.add(; name="JuliaFormatter", uuid="98e50ef6-434e-11e9-1051-2b60c6c9e899") + using JuliaFormatter + format("."; verbose=true) + shell: julia --color=yes {0} + - uses: reviewdog/action-suggester@v1 + if: github.event_name == 'pull_request' + with: + tool_name: JuliaFormatter + fail_on_error: true diff --git a/.github/workflows/IntegrationTest.yml b/.github/workflows/IntegrationTest.yml index 3f4c6d8..a2fbf81 100644 --- a/.github/workflows/IntegrationTest.yml +++ b/.github/workflows/IntegrationTest.yml @@ -3,8 +3,12 @@ name: IntegrationTest on: push: branches: + # This is where pull requests from "bors r+" are built. + - staging + # This is where pull requests from "bors try" are built. + - trying + # Build the main branch. - main - pull_request: jobs: test: diff --git a/bors.toml b/bors.toml new file mode 100644 index 0000000..8fcc206 --- /dev/null +++ b/bors.toml @@ -0,0 +1,18 @@ +status = [ + "Julia 1.% - ubuntu-latest - x64", + "Julia 1.% - macOS-latest - x64", + "Julia 1.% - windows-latest - x64", + "Julia 1 - ubuntu-latest - x64", + "Julia 1 - macOS-latest - x64", + "Julia 1 - windows-latest - x64", + "DynamicPPL.jl", + "format" +] +delete_merged_branches = true +# Require at least on approval of a project member. +required_approvals = 1 +# Squash commits before merging. +use_squash_merge = true +# Uncomment this to use a two hour timeout. +# The default is one hour. +timeout_sec = 7200