- create an action file in
.github/workflows
folder and commit. - Add the badge code into readme and commit & push to see the effect.
## Step 1. say build.yml file
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Make
run: make
## Step 2.
[![Main](https://github.com/mrprajesh/learn-github-actions/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/mrprajesh/learn-github-actions/actions/workflows/build.yml)
- We have two branches
main
anddev
- We have
build.yml
action file for them. See here - We have build status badges for them.
- In addition to
make
and we run the executable generated. - We purposely make the
dev
's code to segfault to see if thedev
badge fails. - The expected behaviour is observed.
- Create different files for different branch so the logs are grouped together