diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..51aa5244 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 565f7e2a..00000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -notifications: - email: false - -sudo: true - -language: python - -python: - - "3.6" - -services: - - docker - -before_install: - - nvm install 13 - -before_script: - - gem install awesome_bot - -script: - - ./run-tests.sh diff --git a/docs/.pages b/docs/.pages deleted file mode 100644 index a9e1b369..00000000 --- a/docs/.pages +++ /dev/null @@ -1,5 +0,0 @@ -arrange: - - index.md - - tools - - cmssw - - analysis diff --git a/docs/about.md b/docs/about.md index 5d6ffae5..d8293113 100644 --- a/docs/about.md +++ b/docs/about.md @@ -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 diff --git a/docs/analysis/datasim/eventgeneration.md b/docs/analysis/datasim/eventgeneration.md index 36f754a9..7fb1e00b 100644 --- a/docs/analysis/datasim/eventgeneration.md +++ b/docs/analysis/datasim/eventgeneration.md @@ -1,4 +1,5 @@ -# Event Generation +# Event Generation + !!! Warning @@ -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. + + diff --git a/run-tests.sh b/run-tests.sh index 59ce88e7..18b272c9 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -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