Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize CI scripts #246

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .ci-scripts/indent
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -e # halt script on error

rm -f /tmp/indent.py
wget -q https://raw.githubusercontent.com/stfc/Pan-Indenter/master/pan_indent_checker.py -O /tmp/indent.py
chmod u+x /tmp/indent.py

git diff --name-only --diff-filter=d HEAD^ | grep '\.pan$' | xargs -rn1 /tmp/indent.py check || exit 1
2 changes: 1 addition & 1 deletion .ci-scripts/panlint
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ rm -f /tmp/panlint.py
wget -q https://raw.githubusercontent.com/quattor/pan/master/panc/src/main/scripts/panlint/panlint.py -O /tmp/panlint.py
chmod u+x /tmp/panlint.py

git diff --name-only HEAD^ | grep '\.pan$' | xargs -r /tmp/panlint.py || exit 1
git diff --name-only --diff-filter=d HEAD^ | grep '\.pan$' | xargs -r /tmp/panlint.py || exit 1
2 changes: 1 addition & 1 deletion .ci-scripts/test-library
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ rm -f /tmp/create-vanilla-SCDB.sh
wget -q https://raw.githubusercontent.com/quattor/scdb/master/utils/scdb/create-vanilla-SCDB.sh -O /tmp/create-vanilla-SCDB.sh
chmod u+x /tmp/create-vanilla-SCDB.sh

/tmp/create-vanilla-SCDB.sh -F --debug --continuous-integration HEAD
/tmp/create-vanilla-SCDB.sh -F --continuous-integration HEAD
34 changes: 23 additions & 11 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,50 @@ name: Run Tests
on: [push, pull_request]

jobs:

test-library:
runs-on: ubuntu-latest
container: centos:7
container: ghcr.io/quattor/quattor-test-container:latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install dependencies
run: yum -y install wget subversion git
- name: Setup Java JDK
uses: actions/[email protected]
with:
java-version: 11
distribution: adopt
run: dnf -y install subversion
- name: run tests
run: .ci-scripts/test-library
env:
TRAVIS_BUILD_DIR: "$GITHUB_WORKSPACE"
TRAVIS_REPO_SLUG: "$GITHUB_REPOSITORY"
TRAVIS_BRANCH: "${GITHUB_HEAD_REF:-master}"

panlint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# we need the full repo or HEAD^ does not work
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.6
python-version: 3
- name: Install dependencies
run: pip install colorama prettytable six
- name: run panlint
run: .ci-scripts/panlint

indentation:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# we need the full repo or HEAD^ does not work
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3
- name: run indent checker
run: .ci-scripts/indent
Loading