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

[Github Config] Launch testing jobs only with code changes #1941

Merged
merged 3 commits into from
Nov 20, 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
50 changes: 50 additions & 0 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: oneDPL CI Docs

on:
push:
branches: [main]
pull_request:
branches:
- release_oneDPL
- main
- 'release/**'

permissions: read-all

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'refs/heads/main') }}

jobs:
codespell:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
run: |
sudo apt update && sudo apt install -y codespell
- name: Run scan
run: |
${GITHUB_WORKSPACE}/.github/scripts/codespell.sh $(pwd)

documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install prerequisites
run: |
echo GITHUB_SHA_SHORT=${GITHUB_SHA::8} >> $GITHUB_ENV
python -m pip install -r documentation/library_guide/requirements.txt
- name: Build documentation
run: |
mkdir html
sphinx-build -b html documentation/library_guide/ html/
- name: Archive build directory
uses: actions/upload-artifact@v4
with:
name: onedpl-html-docs-${{ env.GITHUB_SHA_SHORT }}
path: html
44 changes: 10 additions & 34 deletions .github/workflows/ci.yml → .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: oneDPL CI
name: oneDPL CI Testing

on:
push:
Expand All @@ -8,6 +8,15 @@ on:
- release_oneDPL
- main
- 'release/**'
paths:
- '.github/**/*'
- 'cmake/**/*'
- 'include/**/*'
- 'test/**/*'
- 'CMakeLists.txt'
Comment on lines +11 to +15
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 is the important addition, everything else is just separating / moving the jobs as is to a new workflow

Copy link
Contributor

@MikeDvorskiy MikeDvorskiy Nov 20, 2024

Choose a reason for hiding this comment

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

I guess, we should add examples and make as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, I was thinking about changes which would impact the test results.
As far as I know, we don't test the examples in the CI.
I believe the make configuration is more of a legacy thing which is made available to people but goes unused in the CI. I believe the CI tests use cmake. I'm honestly not sure the make configuration still works, it looks like you had the last change to that directory, are you still using / maintaining those build files?

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. about make:
    I don't know reasons why 'make' would not work.
    Make configuration still works, I use it.
    But if CI doesn't use make files, we can exclude that folder, of course.

  2. "we don't test the examples in the CI."..
    Interesting, it was done intentionally to minimize CI per commit time or just we forgot about that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. about make:
    I don't know reasons why 'make' would not work.
    Make configuration still works, I use it.
    But if CI doesn't use make files, we can exclude that folder, of course.

As far as I understand, the CI generates "fresh" build configuration using cmake, then uses that build configuration to build the tests. Of course, there is nothing wrong with using the make config if it works, it just has not changed much in the last few years and I don't actively use it. So I'm not aware of its current support for all cases.

  1. "we don't test the examples in the CI."..
    Interesting, it was done intentionally to minimize CI per commit time or just we forgot about that?

Its possible we build and run the examples and I am unaware of it. I can try to look into this. It would be a good idea to do if we aren't already. I suppose we can add it in here in anticipation of adding these to the CI in the future.

Copy link
Contributor

@dmitriy-sobolev dmitriy-sobolev Nov 20, 2024

Choose a reason for hiding this comment

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

Should the paths include CMakeLists.txt as well? This is what the CI uses.

Including the rest (e.g. make and examples) seems unnecessary to me as it is not currently handled by the CI. Moreover, when CI is skipped, it is a good indicator that a certain feature has not been tested.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point about CMakeLists.txt ...
Let me add that.
I'm OK with leaving out examples for now, and adding it if we add it in the future to the CI.

- '.clang-format'



permissions: read-all

Expand Down Expand Up @@ -57,39 +66,6 @@ jobs:
path: clang-format.diff
retention-days: 3

codespell:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
run: |
sudo apt update && sudo apt install -y codespell
- name: Run scan
run: |
${GITHUB_WORKSPACE}/.github/scripts/codespell.sh $(pwd)

documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install prerequisites
run: |
echo GITHUB_SHA_SHORT=${GITHUB_SHA::8} >> $GITHUB_ENV
python -m pip install -r documentation/library_guide/requirements.txt
- name: Build documentation
run: |
mkdir html
sphinx-build -b html documentation/library_guide/ html/
- name: Archive build directory
uses: actions/upload-artifact@v4
with:
name: onedpl-html-docs-${{ env.GITHUB_SHA_SHORT }}
path: html

linux-testing:
name: ${{ matrix.device_type }},bknd=${{ matrix.backend }},cmplr=${{ matrix.cxx_compiler }},${{ matrix.os }},std=с++${{ matrix.std }},cfg=${{ matrix.build_type }}
runs-on: ['${{ matrix.os }}']
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# oneAPI DPC++ Library (oneDPL) <img align="right" width="200" height="100" src=https://github.com/uxlfoundation/artwork/blob/main/foundation/uxl-foundation-logo-horizontal-color.svg>
[![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE.txt) [![oneDPL CI](https://github.com/oneapi-src/oneDPL/actions/workflows/ci.yml/badge.svg)](https://github.com/oneapi-src/oneDPL/actions/workflows/ci.yml?query=branch%3Amaster)
[![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE.txt) [![oneDPL CI](https://github.com/oneapi-src/oneDPL/actions/workflows/ci-testing.yml/badge.svg)](https://github.com/oneapi-src/oneDPL/actions/workflows/ci-testing.yml?query=branch%3Amaster)
[![Join the community on GitHub Discussions](https://badgen.net/badge/join%20the%20discussion/on%20github/blue?icon=github)](https://github.com/oneapi-src/oneDPL/discussions)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/oneapi-src/oneDPL/badge)](https://securityscorecards.dev/viewer/?uri=github.com/oneapi-src/oneDPL)

Expand Down
Loading