Skip to content

Commit

Permalink
solved conflicts in onepass.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcaillau committed Aug 29, 2024
2 parents 968ae6e + 5db9d88 commit 98aff2a
Show file tree
Hide file tree
Showing 75 changed files with 10,776 additions and 7,722 deletions.
7 changes: 7 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
margin = 100
indent = 4
whitespace_typedefs = true
whitespace_ops_in_indices = true
remove_extra_newlines = true
annotate_untyped_fields_with_any = false
normalize_line_endings = "unix"
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/blank-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Blank issue
about: Blank template for general issue
title: "[General] title"
labels: ''
assignees: ocots

---


31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a bug report to help us improve
title: "[Bug] title"
labels: bug
assignees: ocots

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Give if possible the code to reproduce the error:

```julia
julia> f(x)=1
f (generic function with 1 method)

julia> f()
ERROR: MethodError: no method matching f()
```

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: CTBase.jl package support
url: https://github.com/control-toolbox/CTBase.jl/discussions
about: Please ask and answer questions about CTBase.jl here.
- name: Control-toolbox organisation support
url: https://github.com/orgs/control-toolbox/discussions
about: For more general questions about control-toolbox ecosystem it's here.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/developers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 'Developers '
about: Suggest internal modifications
title: "[Dev] title"
labels: internal dev
assignees: ocots

---


10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation-suggestion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Documentation suggestion
about: Suggest improvements or additions to the documentation
title: "[Doc] title"
labels: documentation
assignees: ocots

---

**Please detail your suggestion.**
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature] title"
labels: enhancement
assignees: ocots

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
pull-requests: write
steps:
- name: 'Auto-assign issue'
uses: pozil/auto-assign-issue@v1
uses: pozil/auto-assign-issue@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
assignees: ocots, jbcaillau
numOfAssignee: 2
assignees: ocots
numOfAssignee: 1
129 changes: 129 additions & 0 deletions .github/workflows/Breakage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Ref: https://securitylab.github.com/research/github-actions-preventing-pwn-requests
name: Breakage

# read-only repo token
# no access to secrets
on:
pull_request:

jobs:
break:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pkg: [
"control-toolbox/CTDirect.jl",
"control-toolbox/CTFlows.jl",
"control-toolbox/OptimalControl.jl"
]
pkgversion: [latest, stable]

steps:
- uses: actions/checkout@v4

# Install Julia
- uses: julia-actions/setup-julia@latest
with:
version: 1
arch: x64
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1

# Breakage test
- name: 'Breakage of ${{ matrix.pkg }}, ${{ matrix.pkgversion }} version'
env:
URL: ${{ matrix.pkg }}
VERSION: ${{ matrix.pkgversion }}
run: |
set -v
mkdir -p ./pr
echo "${{ github.event.number }}" > ./pr/NR
git clone https://github.com/$URL
export PKG=$(echo $URL | cut -f2 -d/)
cd $PKG
if [ $VERSION == "stable" ]; then
TAG=$(git tag -l "v*" --sort=-creatordate | head -n1)
if [ -z "$TAG" ]; then
TAG="no_tag"
else
git checkout $TAG
fi
else
TAG=$VERSION
fi
export TAG
julia -e 'using Pkg;
PKG, TAG, VERSION = ENV["PKG"], ENV["TAG"], ENV["VERSION"]
joburl = joinpath(ENV["GITHUB_SERVER_URL"], ENV["GITHUB_REPOSITORY"], "actions/runs", ENV["GITHUB_RUN_ID"])
open("../pr/$PKG-$VERSION", "w") do io
try
TAG == "no_tag" && error("Not tag for $VERSION")
pkg"activate .";
pkg"instantiate";
pkg"dev ../";
pkg"build";
pkg"test";
print(io, "[![](https://img.shields.io/badge/$TAG-Pass-green)]($joburl)");
catch e
@error e;
print(io, "[![](https://img.shields.io/badge/$TAG-Fail-red)]($joburl)");
end;
end'
- uses: actions/upload-artifact@v2
with:
name: pr
path: pr/

upload:
needs: break
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@v2
with:
name: pr
path: pr/

- run: ls
- run: |
cd pr
echo "| Package name | latest | stable |" > MSG
echo "|--|--|--|" >> MSG
count=0
for file in *
do
[ "$file" == "NR" ] && continue
[ "$file" == "MSG" ] && continue
if [ $count == "0" ]; then
name=$(echo $file | cut -f1 -d-)
echo -n "| $name | "
else
echo -n "| "
fi
cat $file
if [ $count == "0" ]; then
echo -n " "
count=1
else
echo " |"
count=0
fi
done >> MSG
- uses: actions/upload-artifact@v2
with:
name: pr
path: pr/
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- develop
tags: '*'
pull_request:
jobs:
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/CommentPR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Ref: https://securitylab.github.com/research/github-actions-preventing-pwn-requests
name: Comment on the pull request

# read-write repo token
# access to secrets
on:
workflow_run:
workflows: ["Breakage"]
types:
- completed

jobs:
upload:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: 'Download artifact'
uses: actions/[email protected]
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
- run: unzip pr.zip

- name: 'Comment on PR'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs')
var issue_number = Number(fs.readFileSync('./NR'))
var msg = fs.readFileSync('./MSG', 'utf8')
// Get the existing comments.
const {data: comments} = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number
})
// Find any comment already made by the bot.
const botComment = comments.find(comment => comment.user.id === 41898282)
if (botComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: msg
})
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: msg
})
}
46 changes: 46 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# CompatHelper v3.5.0
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- 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'
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 }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- uses: julia-actions/julia-processcoverage@latest
- uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Loading

0 comments on commit 98aff2a

Please sign in to comment.