From 1dcae92e7567c3f1a556c8bb22570ecfbeb67817 Mon Sep 17 00:00:00 2001 From: Joe Clapis Date: Tue, 30 Apr 2024 14:53:45 -0400 Subject: [PATCH] Migrated GitHub workflows from the SN --- .github/workflows/build.yml | 20 ++++++++++++++ .github/workflows/commits.yml | 14 ++++++++++ .github/workflows/lint.yml | 47 ++++++++++++++++++++++++++++++++ .github/workflows/unit-tests.yml | 20 ++++++++++++++ 4 files changed, 101 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/commits.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..3129a0e4 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,20 @@ +name: Hyperdrive Build +on: + push: + tags: + - v* + branches: + - master + - main + pull_request: +permissions: + contents: read +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: 1.21.8 + - run: cd ${GITHUB_WORKSPACE}/hyperdrive-cli && go build . diff --git a/.github/workflows/commits.yml b/.github/workflows/commits.yml new file mode 100644 index 00000000..1c9df192 --- /dev/null +++ b/.github/workflows/commits.yml @@ -0,0 +1,14 @@ +# Taken from https://github.com/marketplace/actions/block-fixup-commit-merge?version=v2.0.0 +# Updated to use newer ubuntu and checkout action +name: Git Checks + +on: [pull_request] + +jobs: + block-fixup: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Block Fixup Commit Merge + uses: 13rac1/block-fixup-merge-action@v2.0.0 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..bba5b309 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,47 @@ +# Taken from https://github.com/golangci/golangci-lint-action +name: golangci-lint +on: + push: + tags: + - v* + branches: + - master + - main + pull_request: +permissions: + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + # pull-requests: read +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v4 + with: + go-version: 1.21.8 + - uses: actions/checkout@v3 + - name: golangci-lint + uses: golangci/golangci-lint-action@v4 + with: + # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version + version: latest + + # Optional: working directory, useful for monorepos + # working-directory: somedir + + # Optional: golangci-lint command line arguments. + # args: --issues-exit-code=0 + + # Optional: show only new issues if it's a pull request. The default value is `false`. + # only-new-issues: true + + # Optional: if set to true then the all caching functionality will be complete disabled, + # takes precedence over all other caching options. + # skip-cache: true + + # Optional: if set to true then the action don't cache or restore ~/go/pkg. + # skip-pkg-cache: true + + # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. + # skip-build-cache: true diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 00000000..850547e0 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,20 @@ +name: Hyperdrive Unit Tests +on: + push: + tags: + - v* + branches: + - master + - main + pull_request: +permissions: + contents: read +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: 1.21.8 + - run: go test ./...