Help a newbie: How to execute an executable?

All,

I feel really stupid right now, but for the life of me I can’t figure out how to do the most basic things with GitHub Actions. To play around, I setup a very boring Fortran project (https://github.com/mathomp4/PreciseSum) and in there I have a code that you can do ‘make’ and the run ‘./test.exe’.

So, I tried to follow a few examples online to build it (no Fortran in the starter workflows), and got to:

name: CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Install gfortran
      run: |
         sudo add-apt-repository ppa:ubuntu-toolchain-r/test
         sudo apt update
         sudo apt-get install gfortran-9
    - name: Show gfortran version
      run: gfortran-9 --version
    - name: Build
      run: make FC=gfortran-9
    - name: List files
      run: ls
    - name: Run
      run: ./text.exe

It seems to build just fine, but trying to execute it fails:

./text.exe
  shell: /bin/bash -e {0}
/home/runner/work/_temp/33162838-038b-4046-83df-f2df171cf5a1.sh: line 1: ./text.exe: No such file or directory
##[error]Process completed with exit code 127.

How does one do this with GitHub Actions? Or can one?

You said that “I have a code that you can do ‘make’ and the run ‘./test.exe’. “

After build the Fortran project, test.exe is generated . And you can see it in List files step.

In run step, you use wrong text.exe. Correct it to test.exe will fix your issue.

Sigh. I am an idiot. Looking at all the hard issues and searching docs and, typo!

1 Like