Skip to content

Commit

Permalink
ci: adding GitHub Actions Workflows linting
Browse files Browse the repository at this point in the history
  • Loading branch information
DeveloperC286 committed Jul 24, 2024
1 parent 15bbcaf commit db9028f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/github-actions-workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: GitHub Actions Workflows

on: pull_request

env:
# Forcing Earthly to use colours, to make reading output easier.
FORCE_COLOR: 1

jobs:
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Download Earthly v0.8.12.
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.12/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
- name: Checkout code.
uses: actions/checkout@v3
- name: Check GitHub Actions workflows linting.
run: earthly +check-github-actions-workflows-linting
24 changes: 24 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
VERSION 0.7


COPY_CI_DATA:
COMMAND
COPY --dir "ci/" ".github/" "./"


golang-base:
FROM golang:1.22.1
ENV GOPROXY=direct
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64


check-github-actions-workflows-linting:
FROM +golang-base
RUN go install github.com/rhysd/actionlint/cmd/[email protected]
DO +COPY_CI_DATA
RUN ./ci/check-github-actions-workflows-linting.sh


check-linting:
BUILD +check-github-actions-workflows-linting


e2e-formatting-base:
FROM python:3.12.0-slim
COPY "./ci" "./ci"
Expand Down
6 changes: 6 additions & 0 deletions ci/check-github-actions-workflows-linting.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh

set -o errexit
set -o xtrace

actionlint --verbose .github/workflows/*

0 comments on commit db9028f

Please sign in to comment.