ci: remove unused actions

Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
Paul Meyer 2023-08-03 15:05:04 +02:00
parent 9d90ab6df7
commit dccb1dfde9
4 changed files with 22 additions and 129 deletions

View File

@ -1,26 +0,0 @@
name: Install Docgen
description: |
Install Docgen
runs:
using: "composite"
steps:
- name: Checkout talos
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0
repository: "siderolabs/talos"
ref: "v1.3.1"
path: talos
# This is required to be able to build docgen
- name: Remove go.work
shell: bash
working-directory: talos
run: rm go.work*
- name: Install Docgen
shell: bash
working-directory: talos/hack/docgen
run: |
go build -o docgen .
mv docgen /usr/local/bin

View File

@ -1,24 +0,0 @@
name: Install operator-sdk
description: |
Installs the operator-sdk binary.
inputs:
version:
description: "Version of the operator-sdk to install"
required: true
runs:
using: "composite"
steps:
- name: Install operator-sdk
shell: bash
run: |
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
export OS=$(uname | awk '{print tolower($0)}')
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/${{ inputs.version }}
curl -fsSLO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}
gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E
curl -fsSLO ${OPERATOR_SDK_DL_URL}/checksums.txt
curl -fsSLO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc
gpg -u "Operator SDK (release) <cncf-operator-sdk@cncf.io>" --verify checksums.txt.asc
grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c -
chmod +x operator-sdk_${OS}_${ARCH} && sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk
rm checksums.txt checksums.txt.asc

View File

@ -1,57 +0,0 @@
name: Setup Linux build environment
description: "Setup a Linux Build environment (for self-hosted runners)"
runs:
using: "composite"
steps:
- name: Setup custom apt repositories (azure-cli & yq)
shell: bash
run: |
sudo apt-get update
sudo apt-get install ca-certificates curl apt-transport-https lsb-release gnupg -y
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc |
gpg --dearmor |
sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
AZ_REPO=$(lsb_release -cs)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" |
sudo tee /etc/apt/sources.list.d/azure-cli.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
sudo add-apt-repository ppa:rmescandon/yq
- name: Update apt repository information
shell: bash
run: |
sudo apt-get update
- name: Install build-essential & CMake
shell: bash
run: |
sudo apt-get install \
build-essential cmake \
-y
- name: Install curl gpg
shell: bash
run: |
sudo apt-get install curl gpg -y
- name: Install yq jq
shell: bash
run: |
sudo apt-get install yq jq -y
- name: Install AWS CLI
shell: bash
run: |
sudo apt-get -y install awscli
- name: Install az CLI
shell: bash
run: |
sudo apt-get install azure-cli -y
- name: Set up gcloud CLI
uses: google-github-actions/setup-gcloud@e30db14379863a8c79331b04a9969f4c1e225e0b # v1.1.1
- name: Set up Docker Buildx
id: docker-setup
uses: docker/setup-buildx-action@16c0bc4a6e6ada2cfd8afd41d22d95379cf7c32a # v2.8.0

View File

@ -19,41 +19,41 @@ cd "${BUILD_WORKSPACE_DIRECTORY}"
# .github/actions that are not used in any workflow or action YAML. # .github/actions that are not used in any workflow or action YAML.
# We only want directory of that exact level and ignore subdirectories. # We only want directory of that exact level and ignore subdirectories.
actionNames=$( actionNames=$(
find .github/actions \ find .github/actions \
-maxdepth 2 \ -maxdepth 2 \
-type d \ -type d \
! -name actions ! -name actions
) )
actionYMLs=$( actionYMLs=$(
find .github/actions \ find .github/actions \
! -name actions \ ! -name actions \
-type f \ -type f \
-name '*.yml' -name '*.yml'
) )
workflowYMLs=$( workflowYMLs=$(
find .github/workflows \ find .github/workflows \
-type f \ -type f \
-name '*.yml' -name '*.yml'
) )
exitcode=0 exitcode=0
for action in ${actionNames}; do for action in ${actionNames}; do
used=false used=false
for yml in ${actionYMLs} ${workflowYMLs}; do for yml in ${actionYMLs} ${workflowYMLs}; do
if grep -q "${action}" "${yml}"; then if grep -q "${action}" "${yml}"; then
used=true used=true
break break
fi
done
if ! ${used}; then
echo "Action ${action} is unused"
exitcode=1
fi fi
done
if ! ${used}; then
echo "Action ${action} is unused"
exitcode=1
fi
done done
exit "${exitcode}" exit "${exitcode}"