Skip to content

Commit

Permalink
Add GitHub Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
F21 committed Mar 26, 2024
1 parent ce17a61 commit 8cf307f
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -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 }}
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
24 changes: 24 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 8cf307f

Please sign in to comment.