diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..d6f49421 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..28e944d5 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,37 @@ +name: CI + +on: pull_request + +jobs: + jjb: + runs-on: ubuntu-latest + name: Jenkins Job Builder + steps: + - uses: actions/checkout@v2 + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: '3' + - name: Restore pip cache + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-{{ runner.python-version }}-pip-${{ hashFiles('**/requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: | + pip install -r requirements.txt + - name: Run tests + run: | + for d in theforeman.org; do + DIR="." + ( cd $d && jenkins-jobs -l debug test -r $DIR ) + ( cd $d && jenkins-jobs test -r $DIR --config-xml -o output && find output -name config.xml -exec python ../jenkins-lint.py --xml {} + && rm -rf output ) + done + + for d in centos.org; do + DIR="jobs" + ( cd $d && jenkins-jobs -l debug test -r $DIR ) + ( cd $d && jenkins-jobs test -r $DIR --config-xml -o output && find output -name config.xml -exec python ../jenkins-lint.py --xml {} + && rm -rf output ) + done diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..b321a629 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +jenkins-job-builder +lxml +requests