From 94fc3c417fb87978b7050b947ac9d4f063cc9057 Mon Sep 17 00:00:00 2001 From: Jeff Carter Date: Thu, 5 Mar 2026 16:28:45 -0500 Subject: [PATCH] Add workflows for tests, lint, and tag --- .github/workflows/ociregistry-lint.yml | 31 +++++++++++++++++++++++++ .github/workflows/ociregistry-tag.yml | 32 ++++++++++++++++++++++++++ .github/workflows/ociregistry-test.yml | 28 ++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 .github/workflows/ociregistry-lint.yml create mode 100644 .github/workflows/ociregistry-tag.yml create mode 100644 .github/workflows/ociregistry-test.yml diff --git a/.github/workflows/ociregistry-lint.yml b/.github/workflows/ociregistry-lint.yml new file mode 100644 index 0000000..c9fcc68 --- /dev/null +++ b/.github/workflows/ociregistry-lint.yml @@ -0,0 +1,31 @@ +name: "ociregistry: lint" + +on: + pull_request: + paths: + - "ociregistry/**" + - ".github/workflows/ociregistry-lint.yml" + +permissions: + contents: read + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + defaults: + run: + working-directory: ociregistry + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version-file: ociregistry/go.mod + cache-dependency-path: ociregistry/go.sum + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v7 + with: + version: v2.10.1 + working-directory: ociregistry diff --git a/.github/workflows/ociregistry-tag.yml b/.github/workflows/ociregistry-tag.yml new file mode 100644 index 0000000..0aea47e --- /dev/null +++ b/.github/workflows/ociregistry-tag.yml @@ -0,0 +1,32 @@ +name: "ociregistry: tag" + +on: + push: + branches: + - main + paths: + - "ociregistry/**" + - ".github/workflows/ociregistry-tag.yml" + +permissions: + contents: write + +jobs: + tag: + name: Bump version and tag + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: "0" + + - name: Bump version and push tag + uses: anothrNick/github-tag-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DEFAULT_BUMP: patch + INITIAL_VERSION: 0.0.0 + TAG_PREFIX: ociregistry/v + MAJOR_STRING_TOKEN: (MAJOR) + MINOR_STRING_TOKEN: (MINOR) + BRANCH_HISTORY: compare diff --git a/.github/workflows/ociregistry-test.yml b/.github/workflows/ociregistry-test.yml new file mode 100644 index 0000000..03d085a --- /dev/null +++ b/.github/workflows/ociregistry-test.yml @@ -0,0 +1,28 @@ +name: "ociregistry: test" + +on: + pull_request: + paths: + - "ociregistry/**" + - ".github/workflows/ociregistry-test.yml" + +permissions: + contents: read + +jobs: + test: + name: Test + runs-on: ubuntu-latest + defaults: + run: + working-directory: ociregistry + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version-file: ociregistry/go.mod + cache-dependency-path: ociregistry/go.sum + + - name: Run tests + run: go test -race -count=1 ./...