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

ci: Add GitHub Actions based CI #1591

Merged
merged 2 commits into from
Jan 17, 2022

Conversation

matthewfeickert
Copy link
Contributor

@matthewfeickert matthewfeickert commented Jan 14, 2022

Resolves #1589

Use GitHub Actions to add a CI workflow that runs on:

  • push events to master or on tags
  • pull request events targeting master
  • a weekly CRON job that runs every Sunday at 01:23 UTC
  • on GitHub releases
  • on demand against any branch through workflow dispatch

Using concurrency groups if an event triggers another run of the workflow while a previous run in ongoing, the older run will be automatically canceled to avoid wasting resources.

The jobs target CentOS based workflow to start off with:

  • Building with CMake like a user would and then running some libXrdCl tests. This build is a shorter build.
  • Building with CMake like a user would but with Python 3 pip, setuptools, and wheel updated to the latest releases to check that users running with modern releases won't hit breaking changes.
  • Building in full RPM.
  • Building a Python sdist with the publishing workflow scripts.
  • Building a Python sdist with the publishing workflow scripts, but with Python 3 pip, setuptools, and wheel updated to the latest releases to check that users running with modern releases won't hit breaking changes.

At the moment only CentOS based jobs are added as Debian based jobs will fail for installation of the Python bindings given the Issues related to Issue #1579 and PR #1585 and #1586. Debian based jobs can be added along with fixes to these.

Use GitHub Actions to add a CI workflow that runs on:

* push events to master or on tags
* pull request events targeting master
* a weekly CRON job that runs every Sunday at 01:23 UTC
* on GitHub releases
* on demand against any branch through workflow dispatch

Using concurrency groups if an event triggers another run of the workflow
while a previous run in ongoing, the older run will be automaticcally
canceled to avoid wasting resources.

The jobs targeti CentOS based workflow to start off with:

* Building with CMake like a user would and then running some libXrdCl tests.
This build is a shorter build.
* Building with CMake like a user would but with Python 3 pip, setuptools, and
wheel updated to the latest releases to check that users running with modern
releases won't hit breaking changes.
* Building in full RPM.
* Building a Python sdist with the publishing workflow scripts.
* Building a Python sdist with the publishing workflow scripts, but with
Python 3 pip, setuptools, and wheel updated to the latest releases to check
that users running with modern releases won't hit breaking changes.
Travis CI is essentially deprecated
Comment on lines +22 to +24
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This concurrency group will automatically cancel previous runs if a run on the same branch is triggered.

group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub Actions is a bit verbose, so there isn't much of a way to simplify this at the moment.

Comment on lines +54 to +56
# Need to use v1 of action as image Git is too old
- name: Clone repository now that Git is available
uses: actions/checkout@v1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The faster/nicer v2 of this action requires Git 2.18, and CentOS 7 ships v1.8.3.1, so fall back to the old version here which still works.

Comment on lines +95 to +97
# ./common/test-runner ./XrdClTests/libXrdClTests.so 'All Tests/PostMasterTest/'
# ./common/test-runner ./XrdClTests/libXrdClTests.so 'All Tests/FileSystemTest/'
# ./common/test-runner ./XrdClTests/libXrdClTests.so 'All Tests/LocalFileHandlerTest/'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests failed, so I left them in here as a TODO of sorts.

git \
cppunit-devel
yum clean all
python3 -m pip --no-cache-dir install --upgrade pip setuptools wheel
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added these updated-python jobs as it is important to check for changes that have happened in the pip and setuptools world that happen since CentOS 7 ships very old releases. Future Debian jobs will do a better job of checking this, as they have newer CPython releases while CentOS's Python 3.6 is capped out at setuptools 59.6.0 as setuptools 59.7.0+ is Python 3.7+.

@matthewfeickert
Copy link
Contributor Author

@simonmichal This is ready for review. To see this run in full please take a look at https://github.com/matthewfeickert/xrootd/runs/4819530943?check_suite_focus=true on my fork

run_all

where I've just forced things to run

$ git diff origin/ci/add-build-ci-workflow 86d8ef3
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 2a93fd474..2959276fe 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -2,10 +2,10 @@ name: build
 
 on:
   push:
-    branches:
-    - master
-    tags:
-    - v*
+    # branches:
+    # - master
+    # tags:
+    # - v*
   pull_request:
     branches:
     - master

container: gitlab-registry.cern.ch/linuxsupport/cc7-base:latest

steps:
- name: Install external dependencies with yum
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll note that these jobs fail sometimes infrequently because a mirror fails to be found in time. If these get restarted they pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add PR facing CI with GitHub Actions
2 participants