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

20241123 fix ci required jobs #30

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
67 changes: 56 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,44 @@ on:
branches: [ master ]
tags:
- 'v*'
paths:
- '**'
- '!docs/**'
- '.github/**'
pull_request:
branches: [ master ]
paths:
- '**'
- '!docs/**'
- '.github/**'
merge_group:

jobs:
changed:
runs-on: ubuntu-22.04

# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
docs: ${{ steps.filter.outputs.docs == 'true' || steps.filter.outputs.workflow == 'true' || github.event_name != 'pull_request' }}
code: ${{ steps.filter.outputs.code == 'true' || steps.filter.outputs.workflow == 'true' || github.event_name != 'pull_request' }}

steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request'
- name: Check for file changes
uses: dorny/paths-filter@v2
id: filter
with:
list-files: 'shell'
filters: |
docs:
- 'docs/**'
workflow:
- '.github/**'
code:
- 'photon-*/**'

build-client:
name: "PhotonClient Build"

needs: changed
if: needs.changed.outputs.code == 'true'

defaults:
run:
working-directory: photon-client
Expand All @@ -40,6 +63,11 @@ jobs:
name: built-client
path: photon-client/dist/
build-examples:
name: "Photonlib - Build Examples - ${{ matrix.os }}"
runs-on: ${{ matrix.os }}

needs: changed
if: needs.changed.outputs.code == 'true'

strategy:
fail-fast: false
Expand All @@ -51,9 +79,6 @@ jobs:
architecture: aarch64
- os: ubuntu-22.04

name: "Photonlib - Build Examples - ${{ matrix.os }}"
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -79,6 +104,10 @@ jobs:
run: ./gradlew build
build-gradle:
name: "Gradle Build"

needs: changed
if: needs.changed.outputs.code == 'true'

runs-on: ubuntu-22.04
steps:
# Checkout code.
Expand Down Expand Up @@ -111,6 +140,10 @@ jobs:
file: ./photon-core/build/reports/jacoco/test/jacocoTestReport.xml
build-offline-docs:
name: "Build Offline Docs"

needs: changed
if: needs.changed.outputs.code == 'true'

runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -139,6 +172,10 @@ jobs:
build-photonlib-vendorjson:
name: "Build Vendor JSON"
runs-on: ubuntu-22.04

needs: changed
if: needs.changed.outputs.code == 'true'

steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -183,6 +220,10 @@ jobs:

name: "Photonlib - Build Host - ${{ matrix.artifact-name }}"
runs-on: ${{ matrix.os }}

needs: changed
if: needs.changed.outputs.code == 'true'

steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -226,6 +267,10 @@ jobs:
runs-on: ubuntu-22.04
container: ${{ matrix.container }}
name: "Photonlib - Build Docker - ${{ matrix.artifact-name }}"

needs: changed
if: needs.changed.outputs.code == 'true'

steps:
- uses: actions/checkout@v4
with:
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,8 @@ on:
branches: [ master ]
tags:
- 'v*'
paths:
- '**'
- '!docs/**'
- '.github/**'
pull_request:
branches: [ master ]
paths:
- '**'
- '!docs/**'
- '.github/**'
merge_group:

concurrency:
Expand Down
44 changes: 36 additions & 8 deletions .github/workflows/photon-code-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,8 @@ on:
branches: [ master ]
tags:
- 'v*'
paths:
- '**'
- '!docs/**'
- '.github/**'
pull_request:
branches: [ master ]
paths:
- '**'
- '!docs/**'
- '.github/**'
merge_group:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
Expand All @@ -29,8 +21,42 @@ concurrency:
cancel-in-progress: true

jobs:
changed:
runs-on: ubuntu-22.04
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
docs: ${{ steps.filter.outputs.docs == 'true' || steps.filter.outputs.workflow == 'true' || github.event_name != 'pull_request' }}
code: ${{ steps.filter.outputs.code == 'true' || steps.filter.outputs.workflow == 'true' || github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request'
- name: Check for file changes
uses: dorny/paths-filter@v2
id: filter
with:
list-files: 'shell'
filters: |
docs:
- 'docs/**'
workflow:
- '.github/**'
code:
- 'photon-*/**'

echo:
needs: changed
runs-on: ubuntu-22.04
steps:
- run: echo "code=${{ needs.changed.outputs.code }}"
- run: echo "docs=${{ needs.changed.outputs.docs }}"

build-client:
needs: changed
name: "PhotonClient Build"
if: needs.changed.outputs.code == 'true'
defaults:
run:
working-directory: photon-client
Expand All @@ -52,6 +78,8 @@ jobs:

run_docs:
runs-on: "ubuntu-22.04"
needs: changed
if: needs.changed.outputs.code == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
36 changes: 30 additions & 6 deletions .github/workflows/photonvision-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,47 @@ name: PhotonVision Sphinx Documentation Checks
on:
push:
branches: [ master ]
paths:
- 'docs/**'
- '.github/**'
pull_request:
branches: [ master ]
paths:
- 'docs/**'
- '.github/**'
merge_group:

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
changed:
runs-on: ubuntu-22.04
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
docs: ${{ steps.filter.outputs.docs == 'true' || steps.filter.outputs.workflow == 'true' || github.event_name != 'pull_request' }}
code: ${{ steps.filter.outputs.code == 'true' || steps.filter.outputs.workflow == 'true' || github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request'
- name: Check for file changes
uses: dorny/paths-filter@v2
id: filter
with:
list-files: 'shell'
filters: |
docs:
- 'docs/**'
workflow:
- '.github/**'
code:
- 'photon-*/**'


build:
name: "Build Sphinx docs in Actions"
runs-on: ubuntu-22.04

needs: changed
if: needs.changed.outputs.docs== 'true'

steps:
- uses: actions/checkout@v4

Expand Down
35 changes: 26 additions & 9 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,39 @@ on:
branches: [ master ]
tags:
- 'v*'
paths:
- '**'
- '!docs/**'
- '.github/**'
pull_request:
branches: [ master ]
paths:
- '**'
- '!docs/**'
- '.github/**'
merge_group:

jobs:
changed:
runs-on: ubuntu-22.04
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
# We need to always rerun if workflows change or on commits/tags
py: ${{ steps.filter.outputs.python == 'true' || steps.filter.outputs.workflow == 'true' || github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request'
- name: Check for file changes
uses: dorny/paths-filter@v2
id: filter
with:
list-files: 'shell'
filters: |
workflow:
- '.github/**'
python:
- 'photon-lib/py/**'
buildAndDeploy:
runs-on: ubuntu-22.04

needs: changed
if: ${{ needs.changed.outputs.py }}

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -70,7 +87,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: ./photon-lib/py/dist/
packages-dir: ./photon-lib/py/dist/

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
2 changes: 1 addition & 1 deletion docs/source/404.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ orphan: true

# Requested Page Not Found

This page you were looking for was not found. If you think this is a mistake, [file an issue on our GitHub.](https://github.com/PhotonVision/photonvision-docs/issues)
This page you were looking for was not found :( If you think this is a mistake, [file an issue on our GitHub.](https://github.com/PhotonVision/photonvision-docs/issues)
Loading