Skip to content

AndrewOfC/github_simple_action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contents

Directory Contents
simple_action Simple CMake project with 1 library
multiple_jobs Project comprised of multiple libraries and jobs and final linkage

Running

$ cd simple_action
$ mkdir build
$ cd build
$ make -j
$ ./demo

The heart of your CI in GitHub will be the files in /.github/workflows/.yaml

Each workflow file will represent a task to be done.

YAML

yaml

Simple run

This is a simple workflow file

  • Check out the code from the repository
  • Create a build directory
  • Run cmake in the build directory
  • Build the project
name: Build
on: [push]
jobs:
  BuildAndTest:
    runs-on: ubuntu-18.04
    defaults:
      run:
        shell: bash
    steps:
      - name: Check out repository
        uses: actions/checkout@v2
      - run: mkdir build
      - name: CMake
        working-directory: build
        run: cmake ..
      - name: Build
        working-directory: build
        run: make -j `nproc`
      - name: Test
        working-directory: build
        run: ./demo

Breakdown

Name

It creates a workflow named "Build". The history of the workflow runs can be found under the 'Actions' tab for any given GitHub project

Job BuildAndTest

It has one job "BuildAndTest". Multiple jobs will run in parallel on different machines.
Jobs contain 'steps:' of a yaml sequence that are executed in order. If any fail(i.e. exiting with non-zero status), the entire job will fail and so will the workflow.

Each step is a yaml mapping of the following fields:

Field Value
name: (optional) name of the step to be displayed in summaries
run: command to run. Subject to shell variable and string manipulation
working-directory: working directory to execute in
uses: A prepackaged action

Each step must contain either 'run' or 'uses'

About

Simple Example of Github Action

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published