Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ofmla authored Nov 21, 2023
1 parent 1e974e9 commit d7498a0
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,52 @@ First, we will run a basic workflow which creates a python environment with a fe
* go to **Actions** tab, click on **Python Environment**, and click **Run workflow**: this will manually trigger the workflow ([`dispatch_workflow`](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow))
* click on the newly created run to see the execution progress

# Numerical inverse Laplace transform Visualization Workflow
Next, we will demonstrate how GitHub Actions can be used to display an image in a GitHub README generated by the workflow. In this specific example, the last step of the workflow involves plotting the inverse Laplace transform computed numerically and comparing it with the exact result.

* [`.github/workflows/main.yml`](https://github.com/ofmla/githubactions_intro/blob/main/.github/workflows/main.yml)
* Here's an overview of the workflow:

* Triggering the Workflow:
The workflow is triggered by the workflow_dispatch event, allowing manual execution.

* Job Configuration:
The workflow defines a job named test that runs on different operating systems (ubuntu-latest and windows-latest).
It uses a matrix strategy to vary the operating system and compiler toolchain (GCC, Intel) for testing.

* Permissions:
Permissions are set to allow the default GITHUB_TOKEN to write to the repository's contents.

* Steps:
* a. Checkout Code:
The code is checked out using the actions/checkout action with submodule support.

* b. Get Compiler:
The Fortran compiler is set up based on the specified compiler and version in the matrix.

* c. Setup Fortran Package Manager (FPM):
FPM is configured using the fortran-lang/setup-fpm action.

* d. Run NILP App Test:
The Fortran compiler version is displayed, and FPM is used to run the NILP app in release mode.

* e. Get PNG File:
This step installs gnuplot on Ubuntu and generates a PNG file using the gnuplot script (nilp.p).

* f. Commit:
A commit is made to the GitHub repository, adding any changed or new PNG files.

* g. Upload PNG File:
PNG files from the png/ directory are uploaded as artifacts named "Graphic."

* Conditions:
The last three steps (get png file, commit, upload png file) are conditional on Ubuntu and GCC in the matrix. They execute only if the operating system is Ubuntu and the compiler is GCC.

After the workflow is executed a `nilp.png` file is updated in the repo and is visualized below
```
![alt text](https://raw.githubusercontent.com/ofmla/githubactions_intro/main/png/nilp.png)
```

## License

These materials are for a course intended to provide a (very) quick introduction to GitHub Actions. The course is aimed at a scientific audience. Comments, corrections, and additions are welcome.
Expand Down

0 comments on commit d7498a0

Please sign in to comment.