This repository has been archived by the owner on Oct 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GH actions for pull request workflow (#14)
* Fix Dockerfiles * Add pull_request_workflow GH action * Fix indentation in bash scripts
- Loading branch information
Showing
10 changed files
with
113 additions
and
90 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
|
||
jobs: | ||
|
||
golang_lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "stable" | ||
- run: make deps-update | ||
- run: make fmt | ||
- run: make vet | ||
- run: make lint | ||
# - run: make vendor-diff | ||
- run: make golangci-lint | ||
|
||
golang_unittests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "stable" | ||
- run: make generate | ||
- run: make unit-test | ||
|
||
bash_lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: make build # Creates the ./bin directory required by shellcheck afterward | ||
- run: make shellcheck | ||
- run: make bashate |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
#!/bin/bash | ||
|
||
sudo rm -rf /var/tmp/container_list.done \ | ||
/var/tmp/backup && \ | ||
/var/tmp/backup && \ | ||
sudo rm -f /usr/local/bin/prepare-installation-configuration.sh \ | ||
/usr/local/bin/installation-configuration.sh && \ | ||
/usr/local/bin/installation-configuration.sh && \ | ||
sudo systemctl disable installation-configuration.service && \ | ||
sudo systemctl disable prepare-installation-configuration.service && \ | ||
rm -f /etc/systemd/system/installation-configuration.service \ | ||
/etc/systemd/system/prepare-installation-configuration.service && \ | ||
/etc/systemd/system/prepare-installation-configuration.service && \ | ||
sudo podman rmi quay.io/alosadag/ibu-seed-sno0:oneimage --force && \ | ||
sudo systemctl enable --now kubelet && \ | ||
sudo systemctl enable --now crio | ||
|
||
|
||
sudo systemctl enable --now crio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
#!/bin/bash | ||
|
||
which golangci-lint | ||
if [ $? -ne 0 ]; then | ||
echo "Downloading golangci-lint tool" | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -d -b $(go env GOPATH)/bin v1.51.1 | ||
export GOCACHE=/tmp/ | ||
export GOLANGCI_LINT_CACHE=/tmp/.cache | ||
|
||
|
||
if [ $? -ne 0 ]; then | ||
echo "Install from script failed. Trying go install" | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
if [ $? -ne 0 ]; then | ||
if ! which golangci-lint &> /dev/null; then | ||
echo "Downloading golangci-lint tool..." | ||
if ! curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -d -b "$(go env GOPATH)/bin" v1.51.1; then | ||
echo "Install from script failed. Trying 'go install'..." | ||
if ! go install github.com/golangci/golangci-lint/cmd/[email protected]; then | ||
echo "Install of golangci-lint failed" | ||
exit 1 | ||
fi | ||
fi | ||
fi | ||
|
||
export GOCACHE=/tmp/ | ||
export GOLANGCI_LINT_CACHE=/tmp/.cache | ||
golangci-lint run --verbose --print-resources-usage --modules-download-mode=vendor --timeout=5m0s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
RETVAL=0 | ||
GENERATED_FILES="zz_generated.*.go" | ||
|
||
|
||
cd $GOPATH || fatal "Failed to enter $GOPATH directory" | ||
if ! which golint &> /dev/null; then | ||
echo "Downloading golint tool..." | ||
go install golang.org/x/lint/golint@latest | ||
fi | ||
|
||
for file in $(find . -path ./vendor -prune -o -type f -name '*.go' -print | grep -E -v "$GENERATED_FILES"); do | ||
golint -set_exit_status "$file" | ||
if [[ $? -ne 0 ]]; then | ||
RETVAL=1 | ||
fi | ||
done | ||
|
||
exit $RETVAL |