diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml new file mode 100644 index 0000000..23230d7 --- /dev/null +++ b/.github/workflows/pull-requests.yml @@ -0,0 +1,25 @@ +name: Pull Requests +on: + pull_request_target: + +jobs: + test: + runs-on: ubuntu-latest + environment: + name: "Pull Request Tests" + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Set environment variables from .env + uses: xom9ikk/dotenv@v2.2.0 + - name: Setup go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + - name: Run tests + run: go test -v ./... + env: + VAULT_ACC: '1' + TEST_BACKBLAZEB2_APPLICATION_KEY_ID: ${{ secrets.TEST_BACKBLAZEB2_APPLICATION_KEY_ID }} + TEST_BACKBLAZEB2_APPLICATION_KEY: ${{ secrets.TEST_BACKBLAZEB2_APPLICATION_KEY }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..952e06e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release +on: + push: + tags: + - 'v*' + +permissions: + contents: write + id-token: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set environment variables from .env + uses: xom9ikk/dotenv@v2.2.0 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + - name: Install cosign + uses: sigstore/cosign-installer@v3 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + version: v${{ env.GORELEASER_VERSION }} + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..eb9292e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,24 @@ +name: Tests +on: + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set environment variables from .env + uses: xom9ikk/dotenv@v2.2.0 + - name: Setup go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + - name: Run tests + run: go test -v ./... + env: + VAULT_ACC: '1' + TEST_BACKBLAZEB2_APPLICATION_KEY_ID: ${{ secrets.TEST_BACKBLAZEB2_APPLICATION_KEY_ID }} + TEST_BACKBLAZEB2_APPLICATION_KEY: ${{ secrets.TEST_BACKBLAZEB2_APPLICATION_KEY }} \ No newline at end of file