Skip to content

Commit d7498a0

Browse files
authored
Update README.md
1 parent 1e974e9 commit d7498a0

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

+46
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,52 @@ First, we will run a basic workflow which creates a python environment with a fe
2727
* 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))
2828
* click on the newly created run to see the execution progress
2929

30+
# Numerical inverse Laplace transform Visualization Workflow
31+
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.
32+
33+
* [`.github/workflows/main.yml`](https://github.com/ofmla/githubactions_intro/blob/main/.github/workflows/main.yml)
34+
* Here's an overview of the workflow:
35+
36+
* Triggering the Workflow:
37+
The workflow is triggered by the workflow_dispatch event, allowing manual execution.
38+
39+
* Job Configuration:
40+
The workflow defines a job named test that runs on different operating systems (ubuntu-latest and windows-latest).
41+
It uses a matrix strategy to vary the operating system and compiler toolchain (GCC, Intel) for testing.
42+
43+
* Permissions:
44+
Permissions are set to allow the default GITHUB_TOKEN to write to the repository's contents.
45+
46+
* Steps:
47+
* a. Checkout Code:
48+
The code is checked out using the actions/checkout action with submodule support.
49+
50+
* b. Get Compiler:
51+
The Fortran compiler is set up based on the specified compiler and version in the matrix.
52+
53+
* c. Setup Fortran Package Manager (FPM):
54+
FPM is configured using the fortran-lang/setup-fpm action.
55+
56+
* d. Run NILP App Test:
57+
The Fortran compiler version is displayed, and FPM is used to run the NILP app in release mode.
58+
59+
* e. Get PNG File:
60+
This step installs gnuplot on Ubuntu and generates a PNG file using the gnuplot script (nilp.p).
61+
62+
* f. Commit:
63+
A commit is made to the GitHub repository, adding any changed or new PNG files.
64+
65+
* g. Upload PNG File:
66+
PNG files from the png/ directory are uploaded as artifacts named "Graphic."
67+
68+
* Conditions:
69+
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.
70+
71+
After the workflow is executed a `nilp.png` file is updated in the repo and is visualized below
72+
```
73+
![alt text](https://raw.githubusercontent.com/ofmla/githubactions_intro/main/png/nilp.png)
74+
```
75+
3076
## License
3177

3278
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.

0 commit comments

Comments
 (0)