Skip to content

Commit

Permalink
ci: added github actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
audrium committed Nov 16, 2020
1 parent 2c0d0e4 commit 441f037
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 32 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on: [push, pull_request]

jobs:
lint-shellcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Runs shell script static analysis
run: |
sudo apt-get install shellcheck
./run-tests.sh --check-shellscript
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: "14"

- name: Install project dependences
run: |
sudo apt-get update -y
gem install awesome_bot
pip install --upgrade pip
pip install -r requirements.txt
- name: Lint docs
run: ./run-tests.sh --check-docstyle

- name: Build docs
run: ./run-tests.sh --build-docs
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

5 changes: 0 additions & 5 deletions docs/.pages

This file was deleted.

1 change: 1 addition & 0 deletions docs/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This is the offcial guide for CMS open data. All CMS instructional material is
- Kati Lassila-Perini
- Tibor Šimko
- Marco Vidal García
- Audrius Mecionis

## Contact

Expand Down
5 changes: 4 additions & 1 deletion docs/analysis/datasim/eventgeneration.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Event Generation
# Event Generation
<!-- markdownlint-disable -->
<!-- MarkdownTOC depth=0 -->

!!! Warning
Expand Down Expand Up @@ -267,3 +268,5 @@ In this [example](https://github.com/cms-opendata-analyses/EventProductionExampl
## Example for event generation with 2012 CMSSW machinery

In this [example](https://github.com/cms-opendata-analyses/EventProductionExamplesTool/tree/2012), you will learn how to generate 2012 MC QCD events, which involve the strong interaction between quarks and gluons. Additionally, you will know what are the steps to extract the tracking information of these events.

<!-- markdownlint-restore -->
41 changes: 36 additions & 5 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
#!/bin/sh
#!/bin/bash

npx -p markdownlint-cli markdownlint docs/* && \
awesome_bot --allow-dupe --skip-save-results --allow-redirect docs/**/*.md && \
mkdocs build -v && \
rm -rf site/
# Quit on errors
set -o errexit

# Quit on unbound symbols
set -o nounset

check_script () {
shellcheck run-tests.sh
}

check_docstyle () {
npx -p markdownlint-cli markdownlint docs/*
awesome_bot --allow-dupe --skip-save-results --allow-redirect docs/**/*.md
}

build_docs () {
mkdocs build -v
rm -rf site/
}

if [ $# -eq 0 ]; then
check_script
check_docstyle
build_docs
fi

for arg in "$@"
do
case $arg in
--check-shellscript) check_script;;
--check-docstyle) check_docstyle;;
--build-docs) build_docs;;
*)
esac
done

0 comments on commit 441f037

Please sign in to comment.