Skip to content

Commit

Permalink
Merge pull request #22 from jidicula/dev
Browse files Browse the repository at this point in the history
Update CI and documentation
  • Loading branch information
jidicula authored Dec 27, 2020
2 parents d89bca5 + a0fd56b commit 66b2301
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
Expand Down
17 changes: 4 additions & 13 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
# This is a basic workflow to help you get started with Actions

name: shellcheck

# Controls when the action will run.
on:
push:
branches:
- main
- dev
paths:
- 'entrypoint.sh'
- '**.sh'
- '.github/workflows/shellcheck.yml'
pull_request:
branches:
- main
- dev
paths:
- 'entrypoint.sh'
- '**.sh'
- '.github/workflows/shellcheck.yml'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
lint:
runs-on: ubuntu-20.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- uses: ludeeus/action-shellcheck@1.0.0

35 changes: 35 additions & 0 deletions .github/workflows/shfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: shfmt

on:
push:
branches:
- main
- dev
paths:
- '**.sh'
- '.github/workflows/shfmt.yml'
pull_request:
branches:
- main
- dev
paths:
- '**.sh'
- '.github/workflows/shfmt.yml'

jobs:
format:
env:
SHFMT_VERSION: 3.0.1
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Install shfmt
run: |
sudo wget "https://github.com/mvdan/sh/releases/download/v${SHFMT_VERSION}/shfmt_v${SHFMT_VERSION}_linux_amd64" -O /usr/local/bin/shfmt
sudo chmod +x /usr/local/bin/shfmt
- name: Check .sh files
run: shfmt -d .

10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
| Tag | Docker Image CI | shellcheck | shfmt |
|--------|-----------------|------------|-------|
| v2.0.0 | ![Docker Image CI](https://github.com/jidicula/clang-format-action/workflows/Docker%20Image%20CI/badge.svg?branch=v2.0.0) | ![shellcheck](https://github.com/jidicula/clang-format-action/workflows/shellcheck/badge.svg?branch=v2.0.0) | ![shfmt](https://github.com/jidicula/clang-format-action/workflows/shfmt/badge.svg?branch=v2.0.0) |
| main | ![Docker Image CI](https://github.com/jidicula/clang-format-action/workflows/Docker%20Image%20CI/badge.svg?branch=main) | ![shellcheck](https://github.com/jidicula/clang-format-action/workflows/shellcheck/badge.svg?branch=main) | ![shfmt](https://github.com/jidicula/clang-format-action/workflows/shfmt/badge.svg?branch=main) |
| dev | ![Docker Image CI](https://github.com/jidicula/clang-format-action/workflows/Docker%20Image%20CI/badge.svg?branch=dev) | ![shellcheck](https://github.com/jidicula/clang-format-action/workflows/shellcheck/badge.svg?branch=dev) | ![shfmt](https://github.com/jidicula/clang-format-action/workflows/shfmt/badge.svg?branch=dev) |

![shellcheck](https://github.com/jidicula/clang-format-action/workflows/shellcheck/badge.svg) ![Docker Image CI](https://github.com/jidicula/clang-format-action/workflows/Docker%20Image%20CI/badge.svg)
# clang-format-action
GitHub Action for clang-format
Expand Down Expand Up @@ -33,13 +39,13 @@ To use this action, create a `.github/workflows/clang-format-check.yml` in your

```
name: clang-format Check
on: [push]
on: [push, PR]
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@v1.1.2
uses: jidicula/clang-format-action@v2.0.0
```

0 comments on commit 66b2301

Please sign in to comment.