-
Notifications
You must be signed in to change notification settings - Fork 1
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
various small things #4
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2958b1e
be a bit more generous about versions
exaexa 74ecf81
clean up README
exaexa d68a510
juliaformatter
exaexa d3ec509
remove leftover
exaexa 7130b24
clean up gitignore
exaexa 4b316ab
add github CI
exaexa f653eb8
clean up tests, add reaction_stoichiometry type annotation
exaexa 996d2b1
squash trivial case
exaexa 7f378ac
precise identifiers
exaexa dd6e63b
add corner case tests
exaexa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: | ||
- '1' # This is always the latest stable release in the 1.X series | ||
#- '1.6' # LTS | ||
#- 'nightly' | ||
os: | ||
- ubuntu-latest | ||
#- macOS-latest | ||
#- windows-latest | ||
arch: | ||
- x64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: ${{ matrix.version }} | ||
arch: ${{ matrix.arch }} | ||
- uses: julia-actions/cache@v1 | ||
- uses: julia-actions/julia-buildpkg@latest | ||
- run: | | ||
git config --global user.name Tester | ||
git config --global user.email [email protected] | ||
- uses: julia-actions/julia-runtest@latest | ||
continue-on-error: ${{ matrix.version == 'nightly' }} | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
file: lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
on: | ||
pull_request: | ||
issue_comment: | ||
types: [created] | ||
|
||
name: Formatting | ||
|
||
jobs: | ||
formatting: | ||
if: github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'OWNER' || github.event.issue.user.id == github.event.comment.user.id) && startsWith(github.event.comment.body, '/format') ) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone the repository | ||
uses: actions/checkout@v4 | ||
- name: Checkout the pull request code # this checks out the actual branch so that one can commit into it | ||
if: github.event_name == 'issue_comment' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh pr checkout ${{ github.event.issue.number }} | ||
- name: Install JuliaFormatter and format | ||
run: | | ||
julia --color=yes -e 'import Pkg; Pkg.add("JuliaFormatter")' | ||
julia --color=yes -e 'using JuliaFormatter; format(".")' | ||
- name: Remove trailing whitespace | ||
run: | | ||
find -name '*.jl' -or -name '*.md' -or -name '*.toml' -or -name '*.yml' | while read filename ; do | ||
# remove any trailing spaces | ||
sed --in-place -e 's/\s*$//' "$filename" | ||
# add a final newline if missing | ||
if [[ -s "$filename" && $(tail -c 1 "$filename" |wc -l) -eq 0 ]] ; then | ||
echo >> "$filename" | ||
fi | ||
# squash superfluous final newlines | ||
sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' "$filename" | ||
done | ||
- name: Fail on formatting problems | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
if git diff --exit-code --quiet | ||
then echo "Looks OK" | ||
else echo "Formatting fixes required!"; git diff -p ; exit 1 | ||
fi | ||
- name: Commit fixes | ||
if: github.event_name == 'issue_comment' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
if [ `git status -s | wc -l` -ne 0 ] ; then | ||
git config --local user.name "$GITHUB_ACTOR" | ||
git config --local user.email "[email protected]" | ||
git commit -a -m "automatic formatting" -m "triggered by @$GITHUB_ACTOR on PR #${{ github.event.issue.number }}" | ||
if git push | ||
then gh pr comment ${{ github.event.issue.number }} --body \ | ||
":heavy_check_mark: Auto-formatting triggered by [this comment](${{ github.event.comment.html_url }}) succeeded, commited as `git rev-parse HEAD`" | ||
else gh pr comment ${{ github.event.issue.number }} --body \ | ||
":x: Auto-formatting triggered by [this comment](${{ github.event.comment.html_url }}) failed, perhaps someone pushed to the PR in the meantime?" | ||
fi | ||
else | ||
gh pr comment ${{ github.event.issue.number }} --body \ | ||
":sunny: Auto-formatting triggered by [this comment](${{ github.event.comment.html_url }}) succeeded, but the code was already formatted correctly." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
/.vscode | ||
/vscode | ||
*.code-workspace | ||
/docs/build/ | ||
Manifest.toml | ||
|
||
downloaded/* | ||
test/downloaded/* | ||
*.cov | ||
.*.swp | ||
|
||
.vscode | ||
*.code-workspace | ||
|
||
/test/test-models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
@testset "Miscellaneous tests" begin | ||
# the path is inherited from the main testset | ||
model = A.load(JSONFBCModel, joinpath(@__DIR__, "test-models", "iML1515.json")) | ||
# test that no superfluous keys are generated | ||
@test all( | ||
key in ["metabolites", "id", "compartments", "reactions", "version", "genes"] for | ||
key in keys(model.json) | ||
) | ||
|
||
# caps suffix is quite common | ||
@test all(suffix in A.filename_extensions(JSONFBCModel) for suffix in ["json", "JSON"]) | ||
end | ||
|
||
@testset "Corner cases" begin | ||
import JSONFBCModels: parse_charge | ||
|
||
@test parse_charge(1) == 1 | ||
@test parse_charge(2.0) == 2 | ||
@test parse_charge("3") == 3 | ||
@test parse_charge("4.0") == 4 | ||
@test parse_charge(nothing) == nothing | ||
@test_throws ArgumentError parse_charge("totally positive charge") | ||
@test_throws DomainError parse_charge(["very charged"]) | ||
end |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will have lots of breaking on AFBCMs 0.1