From d7498a0dcb9df8b813b9ba9bf0a90a806c388752 Mon Sep 17 00:00:00 2001 From: Oscar Mojica Date: Tue, 21 Nov 2023 16:40:27 -0300 Subject: [PATCH] Update README.md --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/README.md b/README.md index 3f48851..74161a3 100644 --- a/README.md +++ b/README.md @@ -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.