Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply COPIERTemplate #242

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
margin = 100
annotate_untyped_fields_with_any = false
indent = 2
whitespace_typedefs = true
whitespace_ops_in_indices = true
margin = 100
normalize_line_endings = "unix"
remove_extra_newlines = true
annotate_untyped_fields_with_any = false
normalize_line_endings = "unix"
whitespace_ops_in_indices = true
whitespace_typedefs = true
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ task:
matrix:
- name: FreeBSD
freebsd_instance:
image_family: freebsd-13-2
image_family: freebsd-13-1
env:
matrix:
- JULIA_VERSION: 1.6
Expand Down
14 changes: 14 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changes here will be overwritten by Copier
AddMacToCI: true
AddWinToCI: true
AuthorEmail: [email protected]
AuthorName: Abel Soares Siqueira
JuliaMinVersion: '1.6'
License: MPL-2.0
PackageName: JSOSolvers
PackageOwner: JuliaSmoothOptimizers
PackageUUID: e288b6ff-ca66-4c77-99ae-94f218a9c988
RunJuliaNightlyOnCI: true
UseCirrusCI: true
_commit: v0.2.0
_src_path: https://github.com/abelsiqueira/COPIERTemplate.jl
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://editorconfig.org
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
12 changes: 6 additions & 6 deletions .github/workflows/Breakage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ jobs:
strategy:
fail-fast: false
matrix:
pkg: [
"JuliaSmoothOptimizers/FletcherPenaltySolver.jl",
"JuliaSmoothOptimizers/Percival.jl"
]
pkg:
[
"JuliaSmoothOptimizers/FletcherPenaltySolver.jl",
"JuliaSmoothOptimizers/Percival.jl",
]
pkgversion: [latest, stable]

steps:
Expand All @@ -37,9 +38,8 @@ jobs:
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1

# Breakage test
- name: 'Breakage of ${{ matrix.pkg }}, ${{ matrix.pkgversion }} version'
- name: "Breakage of ${{ matrix.pkg }}, ${{ matrix.pkgversion }} version"
env:
URL: ${{ matrix.pkg }}
VERSION: ${{ matrix.pkgversion }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/CommentPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: 'Download artifact'
- name: "Download artifact"
uses: actions/[email protected]
with:
script: |
Expand All @@ -37,8 +37,7 @@ jobs:
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
- run: unzip pr.zip

- name: 'Comment on PR'
- name: "Comment on PR"
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
44 changes: 37 additions & 7 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,49 @@
# CompatHelper v3.5.0
name: CompatHelper

on:
schedule:
- cron: '00 00 * * *'
- cron: 0 0 * * *
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v1
with:
version: 1
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
version: "1"
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
52 changes: 52 additions & 0 deletions .github/workflows/Copier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Copier Update

on:
schedule:
- cron: 0 7 1/7 * *
workflow_dispatch:

jobs:
Copier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.COPIER_PAT }}
- uses: julia-actions/setup-julia@v1
with:
version: "1"
- name: Use Julia cache
uses: julia-actions/cache@v1
- name: Install JuliaFormatter.jl
run: julia -e 'using Pkg; pkg"add JuliaFormatter"'
- name: Setup Python
uses: actions/setup-python@v4
- name: Check for update in the template
run: |
pip install copier
copier update -A -o rej
echo -e "Automated changed by Copier.yml workflow\n" > /tmp/body.md
echo -e 'Rejected changes (if any):\n```diff\n' >> /tmp/body.md
find . -name "*.rej" | xargs cat >> /tmp/body.md
find . -name "*.rej" | xargs rm -f
echo -e '```' >> /tmp/body.md
git diff
- name: Run pre-commit to run the formatters
run: |
pip install pre-commit
pre-commit run -a || true # Ignore pre-commit errors
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.COPIER_PAT }}
commit-message: ":robot: COPIERTemplate.jl update"
title: "[AUTO] COPIERTemplate.jl update"
body-path: /tmp/body.md
branch: auto-copier-template-update
delete-branch: true
labels: configuration, automated pr, no changelog
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
51 changes: 51 additions & 0 deletions .github/workflows/Docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Docs

on:
push:
branches:
- main
paths:
- "docs/**"
- "src/**"
- "*.toml"
tags: ["*"]
pull_request:
branches:
- main
paths:
- "docs/**"
- "src/**"
- "*.toml"
types: [opened, synchronize, reopened]

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:
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: "1"
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: |
julia --project=docs -e '
using Documenter: DocMeta, doctest
using JSOSolvers
DocMeta.setdocmeta!(JSOSolvers, :DocTestSetup, :(using JSOSolvers); recursive=true)
doctest(JSOSolvers)'
- run: julia --project=docs docs/make.jl
env:
JULIA_PKG_SERVER: ""
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
23 changes: 0 additions & 23 deletions .github/workflows/Documentation.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/Lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint

on:
push:
branches:
- main
tags: ["*"]
pull_request:

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:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v3
- name: Setup Julia
uses: julia-actions/setup-julia@v1
with:
version: "1"
- name: Use Julia cache
uses: julia-actions/cache@v1
- name: Install JuliaFormatter.jl
run: julia -e 'using Pkg; pkg"add JuliaFormatter"'
- name: Setup Python
uses: actions/setup-python@v4
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: SKIP=no-commit-to-branch pre-commit run -a
52 changes: 37 additions & 15 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
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 }}
name: TagBot

on:
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
type: number
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 }}
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
ssh: ${{ secrets.DOCUMENTER_KEY }}
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}
Loading