Skip to content

Commit

Permalink
initial Github Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Aug 29, 2024
1 parent 2203f7e commit 40cbdaa
Show file tree
Hide file tree
Showing 4 changed files with 182 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build

on:
push:
paths:
- 'src/**'
- 'include/**'
- 'Makefile'
- '*.mk'
- '.github/workflows/build.yml'

jobs:

build:
name: Build library

runs-on: ubuntu-latest
env:
CC: gcc
steps:
- uses: actions/checkout@v4

- name: Build static library
run: make static

- name: Build shared library
run: make shared



28 changes: 28 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Static Analysis

on:
push:
paths:
- 'src/**'
- 'include/**'
- 'Makefile'
- '*.mk'
- '.github/workflows/check.yml'

jobs:

cppcheck:
name: Check source code

runs-on: ubuntu-latest
env:
CC: gcc
steps:

- uses: actions/checkout@v4

- name: install dependencies
run: sudo apt-get install -y cppcheck

- name: Run cppcheck
run: make check
113 changes: 113 additions & 0 deletions .github/workflows/dox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: API documentation

on:
release:
types: [published]

push:
paths:
- 'src/**'
- 'include/**'
- 'css/**'
- 'Doxyfile'
- '*.md'
- '.github/workflows/dox.yml'

jobs:

apidocs:
name: Generate API documentation

runs-on: ubuntu-latest
env:
CC: gcc
steps:

- name: install doxygen
run: sudo apt-get install doxygen

- uses: actions/checkout@v4

- name: Generate docs
run: make dox

site-update:
name: Update github pages
needs: apidocs
if: github.repository_owner == 'Smithsonian' && (github.event_name == 'release' || contains(github.event.head_commit.message, 'site update'))

runs-on: ubuntu-latest
steps:

- name: Checkout source
uses: actions/checkout@v4

- name: Generate headless README
run: make README-orig.md

- uses: mattnotmitt/[email protected]
with:
additional-packages: font-roboto

- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: 'gh-pages'
path: site

- name: Assert site/doc/
run: mkdir -p site/doc

- name: Copy README
run: |
echo '<img src="/xchange/resources/CfA-logo.png" alt="CfA logo" width="400" height="67" align="right">' > site/doc/README.md
echo '<br clear="all">' >> site/doc/README.md
cat README-orig.md >> site/doc/README.md
- name: Copy CHANGELOG
run: cp CHANGELOG.md site/doc/

- name: Copy API documentation
run: cp -a apidoc site/

- name: Push to pages
run: |
cd site
git config --global user.email "$GITHUB_JOB+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions"
git add -A
git commit -m "[automated site update]" && git push || true
changelog-update:
name: Update CHANGELOG on github pages
if: github.repository_owner == 'Smithsonian' && contains(github.event.head_commit.message, 'changelog update')

runs-on: ubuntu-latest
steps:

- name: Checkout source
uses: actions/checkout@v4

- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: 'gh-pages'
path: site

- name: Assert site/doc/
run: mkdir -p site/doc

- name: Copy CHANGELOG
run: cp CHANGELOG.md site/doc/

- name: Push to pages
run: |
cd site
git config --global user.email "$GITHUB_JOB+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions"
git add -A
git commit -m "[automated site update]" && git push || true


0 comments on commit 40cbdaa

Please sign in to comment.