-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add CI + dependabot + cleanup
- Loading branch information
Showing
6 changed files
with
244 additions
and
1 deletion.
There are no files selected for viewing
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 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "09:00" | ||
timezone: "Australia/Melbourne" | ||
ignore: | ||
- dependency-name: "*" | ||
update-types: ["version-update:semver-major"] | ||
groups: | ||
docker: | ||
patterns: | ||
- "*" | ||
labels: | ||
- "docker" | ||
- "dependencies" | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "09:00" | ||
timezone: "Australia/Melbourne" | ||
groups: | ||
github: | ||
patterns: | ||
- "*" | ||
labels: | ||
- "ci" | ||
- "dependencies" | ||
|
||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "09:00" | ||
timezone: "Australia/Melbourne" | ||
groups: | ||
go: | ||
patterns: | ||
- "*" | ||
labels: | ||
- "dependencies" |
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,25 @@ | ||
name: "CD" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
tag: | ||
name: Create a new tag | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
outputs: | ||
new_tag: ${{ steps.push-tag.outputs.new_tag }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Push tag | ||
id: push-tag | ||
uses: anothrNick/github-tag-action@1.69.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WITH_V: true | ||
DEFAULT_BUMP: patch |
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,132 @@ | ||
name: "CI" | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
shellcheck: | ||
name: Shellcheck | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run ShellCheck | ||
uses: ludeeus/action-shellcheck@2.0.0 | ||
with: | ||
ignore_paths: "./vendor/**" | ||
|
||
prettier: | ||
name: Prettier | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Prettify code | ||
uses: creyD/prettier_action@v4.3 | ||
with: | ||
dry: true | ||
prettier_options: --log-level debug --check . | ||
|
||
hadolint: | ||
name: hadolint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: hadolint/hadolint-action@v3.1.0 | ||
with: | ||
dockerfile: "Dockerfile.template" | ||
|
||
typocheck: | ||
name: Spell Check with Typos | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Actions Repository | ||
uses: actions/checkout@v4 | ||
- name: Check for typos | ||
uses: crate-ci/typos@master | ||
with: | ||
config: ./.typos.toml | ||
|
||
go-staticcheck: | ||
name: go-staticcheck | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.22" | ||
|
||
- name: Setup staticcheck | ||
run: go install honnef.co/go/tools/cmd/staticcheck@latest | ||
|
||
- name: Run staticcheck | ||
run: staticcheck ./... | ||
|
||
golines: | ||
name: golines | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.22" | ||
|
||
- name: Setup golines | ||
run: go install github.com/segmentio/golines@latest | ||
|
||
- name: Run golines | ||
run: | | ||
golines --write-output --ignored-dirs=vendor . | ||
gosec: | ||
name: gosec | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.22" | ||
|
||
- name: Setup Gosec Security Scanner | ||
run: go install github.com/securego/gosec/v2/cmd/gosec@latest | ||
|
||
- name: Run Gosec Security Scanner | ||
run: make gosec | ||
|
||
test-go-build-run: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
name: Go build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.22" | ||
|
||
- name: Setup docker (missing on MacOS) | ||
if: runner.os == 'macos' | ||
run: | | ||
brew install --HEAD colima | ||
brew install docker | ||
colima start --arch x86_64 | ||
- name: Test Go build | ||
run: go build -o bin/anchor cmd/main.go | ||
|
||
- name: Test Go run | ||
run: go run cmd/main.go -y | ||
|
||
- name: Run Tests | ||
run: make test |
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,38 @@ | ||
name: "Release" | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
release: | ||
name: "Release" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.22" | ||
|
||
- name: Go build all production binaries | ||
run: | | ||
git fetch --tags | ||
make build-all-prod | ||
- name: Create a GitHub Release | ||
run: | | ||
git fetch --tags | ||
previous_release_tag=$(gh release list --json tagName -L 1 --jq '.[0].tagName') | ||
latest_tag="$(git describe --tags --abbrev=0)" | ||
gh release create \ | ||
"${latest_tag}" \ | ||
--title "Release ${latest_tag}" \ | ||
--latest \ | ||
--generate-notes \ | ||
--notes-start-tag "${previous_release_tag}" \ | ||
bin/anchor_linux_amd64 \ | ||
bin/anchor_linux_arm64 \ | ||
bin/anchor_darwin_amd64 \ | ||
bin/anchor_darwin_arm64 \ | ||
bin/anchor_windows_amd64 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Anchor | ||
|
||
A tool for anchoring depencencies in dockerfiles | ||
A tool for anchoring dependencies in dockerfiles |