Skip to content

Commit

Permalink
Update all the workflows?
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Nov 23, 2024
1 parent 2a642c2 commit f5db761
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 34 deletions.
63 changes: 52 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,40 @@ 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' }}
code: ${{ steps.filter.outputs.code == 'true' || steps.filter.outputs.workflow == 'true' }}
steps:
- 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 }}

defaults:
run:
working-directory: photon-client
Expand All @@ -40,6 +59,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 }}

strategy:
fail-fast: false
Expand All @@ -51,9 +75,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 +100,10 @@ jobs:
run: ./gradlew build
build-gradle:
name: "Gradle Build"

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

runs-on: ubuntu-22.04
steps:
# Checkout code.
Expand Down Expand Up @@ -111,6 +136,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 }}

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

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

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

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

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

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

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

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
33 changes: 27 additions & 6 deletions .github/workflows/photonvision-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,44 @@ 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' }}
code: ${{ steps.filter.outputs.code == 'true' || steps.filter.outputs.workflow == 'true' }}
steps:
- name: Check for file changes
uses: dorny/paths-filter@v2
id: filter
with:
list-files: 'shell'
filters: |
docs:
- 'docs/**'
workflow:
- '.github/**'
code:
- 'photon-*/**'
build:
runs-on: ubuntu-22.04

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

steps:
- uses: actions/checkout@v4

Expand Down
32 changes: 23 additions & 9 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,36 @@ 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:
py: ${{ steps.filter.outputs.python == 'true' || steps.filter.outputs.workflow == 'true' }}
steps:
- 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 +84,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

0 comments on commit f5db761

Please sign in to comment.