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

chore(ci): create a pipeline for linting YAML workflow files #2183

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
87609b0
chore(ci): create a pipeline for linting YAML workflow files
nicomiguelino Dec 31, 2024
a1ff303
chore(ci): resolve SC2086
nicomiguelino Jan 1, 2025
d28611a
chore(ci): resolve some more workflow linter comments
nicomiguelino Jan 1, 2025
5cd6953
chore(ci): deploy some more workflow linter issues
nicomiguelino Jan 1, 2025
032b1bf
chore(ci): fix some more workflow linter issues
nicomiguelino Jan 1, 2025
8362ad4
chore(ci): fix some more workflow linter issues
nicomiguelino Jan 1, 2025
fdd5797
chore(ci): fix some more workflow linter issues
nicomiguelino Jan 1, 2025
a2fe7f9
chore(ci): fix Python linter workflow
nicomiguelino Jan 1, 2025
80c03d9
chore(ci): fix Python linter workflow
nicomiguelino Jan 1, 2025
7f4aeb7
Merge branch 'master' into create-workflow-linter-pipeline
nicomiguelino Jan 1, 2025
b52b181
Merge branch 'master' into create-workflow-linter-pipeline
nicomiguelino Jan 1, 2025
e25d687
Merge branch 'master' into create-workflow-linter-pipeline
nicomiguelino Jan 2, 2025
4742616
Merge branch 'master' into create-workflow-linter-pipeline
nicomiguelino Jan 3, 2025
d839d8f
Merge branch 'master' into create-workflow-linter-pipeline
nicomiguelino Jan 6, 2025
ff522ef
Merge branch 'master' into create-workflow-linter-pipeline
nicomiguelino Jan 6, 2025
7dbd247
Merge branch 'master' into create-workflow-linter-pipeline
nicomiguelino Jan 6, 2025
9d973d0
Merge branch 'master' into create-workflow-linter-pipeline
nicomiguelino Jan 14, 2025
6435421
Merge branch 'master' into create-workflow-linter-pipeline
nicomiguelino Jan 15, 2025
27da407
chore: revert trivial changes
nicomiguelino Jan 15, 2025
4a48846
Merge branch 'master' into create-workflow-linter-pipeline
nicomiguelino Jan 15, 2025
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
10 changes: 5 additions & 5 deletions .github/workflows/build-balena-disk-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ jobs:
- name: Get base board
run: |
if [ "${{ matrix.board }}" == 'pi1' ]; then
echo "BALENA_IMAGE=raspberry-pi" >> $GITHUB_ENV
echo "BALENA_IMAGE=raspberry-pi" >> "$GITHUB_ENV"
elif [ "${{ matrix.board }}" == 'pi2' ]; then
echo "BALENA_IMAGE=raspberry-pi2" >> $GITHUB_ENV
echo "BALENA_IMAGE=raspberry-pi2" >> "$GITHUB_ENV"
elif [ "${{ matrix.board }}" == 'pi3' ]; then
echo "BALENA_IMAGE=raspberrypi3" >> $GITHUB_ENV
echo "BALENA_IMAGE=raspberrypi3" >> "$GITHUB_ENV"
elif [ "${{ matrix.board }}" == 'pi4' ]; then
echo "BALENA_IMAGE=raspberrypi4-64" >> $GITHUB_ENV
echo "BALENA_IMAGE=raspberrypi4-64" >> "$GITHUB_ENV"
elif [ "${{ matrix.board }}" == 'pi5' ]; then
echo "BALENA_IMAGE=raspberrypi5" >> $GITHUB_ENV
echo "BALENA_IMAGE=raspberrypi5" >> "$GITHUB_ENV"
fi

- name: balena CLI Action - download
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/build-webview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ jobs:
- name: Set buildx arguments
id: prepare
run: |
echo ::set-output name=buildx_args::\
--cache-from "screenly/ose-qt-builder:latest" \
--output "type=image,push=true" \
--build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
--build-arg "GIT_HASH=$GITHUB_SHA" \
--build-arg "GIT_SHORT_HASH=$(git rev-parse --short HEAD)" \
--build-arg "GIT_BRANCH=$GITHUB_REF_NAME"
echo "buildx_args=\
--cache-from \"screenly/ose-qt-builder:latest\" \
--output \"type=image,push=true\" \
--build-arg \"BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')\" \
--build-arg \"GIT_HASH=$GITHUB_SHA\" \
--build-arg \"GIT_SHORT_HASH=$(git rev-parse --short HEAD)\" \
--build-arg \"GIT_BRANCH=$GITHUB_REF_NAME\"" >> "$GITHUB_OUTPUT"
Comment on lines +36 to +42
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Double-check if this really works.


- name: Building container
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
python bin/build-pi-imager-json.py > _site/rpi-imager.json

# Make sure it's valid
cat _site/rpi-imager.json | jq
jq . < _site/rpi-imager.json
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Double-check if it still works.


# Copy in static files. This is to be migrated to Hugo later.
cp -rf assets _site/
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,22 @@ jobs:

- name: Set Docker tag
run: |
echo "GIT_SHORT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "BOARD=${{ matrix.board }}" >> $GITHUB_ENV
echo "SHM_SIZE=256mb" >> $GITHUB_ENV
{
echo "GIT_SHORT_HASH=$(git rev-parse --short HEAD)"
echo "BOARD=${{ matrix.board }}"
echo "SHM_SIZE=256mb"
} >> "$GITHUB_ENV"

- name: Prepare Balena file
run: |
# Generage a docker-compose file for Balena with the correct board
# Generate a docker-compose file for Balena with the correct board
mkdir -p balena-deploy

# Copy in the Balena yaml file
cp balena.yml balena-deploy/

# Generate the docker-compose file
cat docker-compose.balena.yml.tmpl | \
envsubst > balena-deploy/docker-compose.yml
envsubst < docker-compose.balena.yml.tmpl > balena-deploy/docker-compose.yml

# Remove bind mounts to `/dev/vchiq` for Raspberry Pi 5
if [ "${{ matrix.board }}" == "pi5" ]; then
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/generate-openapi-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ on:
description: 'Upload the OpenAPI schema as a release artifact'
required: true
type: boolean
default: false
tag:
description: 'Tag to be used for the release'
required: true
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/lint-workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Lint GitHub Workflows

on:
pull_request:
branches:
- master
paths:
- '**/*.yml'
- '**/*.yaml'
- '.github/workflows/lint-workflows.yml'
push:
branches:
- master
paths:
- '**/*.yml'
- '**/*.yaml'
- '.github/workflows/lint-workflows.yml'

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install actionlint
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
shell: bash

- name: Run actionlint
run: ./actionlint -color
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/python-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ jobs:
- name: Analyzing the code with flake8
run: |
if [ -n "$(git ls-files '*.py')" ]; then
poetry run flake8 $(git ls-files '*.py')
git ls-files '*.py' | xargs poetry run flake8
fi
3 changes: 3 additions & 0 deletions .github/workflows/sbom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- 'poetry.lock'

jobs:
run-tests:
uses: ./.github/workflows/docker-test.yaml

js-sbom:
needs: run-tests
runs-on: ubuntu-latest
Expand Down
Loading