Skip to content

Commit

Permalink
added formatter action
Browse files Browse the repository at this point in the history
  • Loading branch information
ThummeTo committed Aug 19, 2024
1 parent 8ff0766 commit c5fe840
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/Formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Formatter

on:
pull_request:
push:
branches:
- 'main'
tags: '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Check out repository"
uses: actions/checkout@v4

- name: "Set up Julia"
uses: julia-actions/setup-julia@v2
with:
version: '1.10'
arch: x64

- name: Install JuliaFormatter and format
run: julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter")); using JuliaFormatter; format(".", verbose=true)'

- name: Format check
run: |
julia -e '
out = Cmd(`git diff`) |> read |> String
if out == ""
exit(0)
else
@error "Some files are not formatted! Please use the SciMLStyle to format your files!"
write(stdout, out)
exit(1)
end'
6 changes: 3 additions & 3 deletions cross_checks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ More information: https://github.com/modelica/fmi-cross-check

### Automated run using github actions

The `..\.github\workflow` folder contains a `CrossChecks.yml` file that configures the excecution of the fmi cross checks using a github action.
The `..\.github\workflow` folder contains a `CrossChecks.yml` file that configures the execution of the FMI cross checks using a github action.

This action pulls the fmi cross checks from a repository, excecutes them and pushes the result files back to the repository. These specified repository needs to be forked before from https://github.com/modelica/fmi-cross-check. After forking the fmi-cross-check repository, a access token with repo rights needs to be generated (https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
This action pulls the FMI cross checks from a repository, executes them and pushes the result files back to the repository. These specified repository needs to be forked before from https://github.com/modelica/fmi-cross-check. After forking the fmi-cross-check repository, a access token with repo rights needs to be generated (https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)

In order to use the action you need to be set the following information about your fmi-cross-check repository the FMI.jl repository as secrets and variables.

* (Variable) `CROSS_CHECK_REPO_URL`: The url (without protocol) to your fmi-cross-check repository. (Example: `github.com/johndoe/fmi-cross-check`)
* (Variable) `CROSS_CHECK_REPO_USER`: The user that has write access to the fmi-cross-check repository and for which the token was created. (Example: `johndoe`)
* (Secret) `CROSS_CHECK_REPO_TOKEN`: The github token that was created for the fmi-cross-check repository (Example: `ghp_IqHJF673SD...`)

Not setting these values correctly will prevent the results to be pushed to your fmi-cross-check repositoy. However you will still be able to see the result summary of your run in the github action logs.
Not setting these values correctly will prevent the results to be pushed to your fmi-cross-check repository. However you will still be able to see the result summary of your run in the github action logs.

### Manual run

Expand Down

0 comments on commit c5fe840

Please sign in to comment.