-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add pre-commit and test targets to Earthfile
- Introduce `tests` target in Earthfile for running Go tests. - Add `.github/FUNDING.yml` to specify funding links. - Update `.github/dependabot.yml` with new groups and configurations. - Add `.github/actions/env/action.yml` for setting up environment. - Introduce `.github/workflows/labeler.yml` for PR labeling. - Update `.github/workflows/main.yml` with new job configurations.
- Loading branch information
Showing
8 changed files
with
124 additions
and
56 deletions.
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 @@ | ||
github: FormanceHQ |
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,20 @@ | ||
name: Setup Env | ||
description: Setup Env for Linux x64 | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: "Put back the git branch into git (Earthly uses it for tagging)" | ||
shell: bash | ||
run: | | ||
branch="" | ||
if [ -n "$GITHUB_HEAD_REF" ]; then | ||
branch="$GITHUB_HEAD_REF" | ||
else | ||
branch="${GITHUB_REF##*/}" | ||
fi | ||
git checkout -b "$branch" || true | ||
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,11 +1,29 @@ | ||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: "github-actions" | ||
- package-ecosystem: gomod | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
- package-ecosystem: "gomod" | ||
interval: daily | ||
open-pull-requests-limit: 40 | ||
labels: [ "dependencies" ] | ||
# Groups are updated together in one pull request | ||
groups: | ||
otel: | ||
patterns: | ||
- "go.opentelemetry.io/otel*" | ||
otel-collector: | ||
patterns: | ||
- "go.opentelemetry.io/collector*" | ||
- "github.com/open-telemetry/o*-collector-contrib/*" | ||
otel-instrumentation: | ||
patterns: | ||
- "go.opentelemetry.io/contrib/instrumentation/*" | ||
go-openapi: | ||
patterns: | ||
- "github.com/go-openapi/*" | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
labels: [ "dependencies" ] |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
name: "Pull Request Labeler" | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
PR: | ||
name: Check PR Title | ||
runs-on: ubuntu-latest | ||
permissions: | ||
statuses: write | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,60 @@ | ||
name: Default | ||
on: | ||
merge_group: | ||
push: | ||
branches: | ||
- main | ||
- releases/* | ||
pull_request: | ||
types: [ assigned, opened, synchronize, reopened, labeled ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
name: Main | ||
jobs: | ||
lint: | ||
uses: formancehq/gh-workflows/.github/workflows/golang-lint.yml@main | ||
Dirty: | ||
runs-on: "formance-runner" | ||
steps: | ||
- uses: 'actions/checkout@v4' | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Env | ||
uses: ./.github/actions/env | ||
- run: > | ||
earthly | ||
--allow-privileged | ||
--secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY | ||
${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }} | ||
+pre-commit | ||
env: | ||
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }} | ||
- name: Get changed files | ||
id: changed-files | ||
shell: bash | ||
run: | | ||
hasChanged=$(git status --porcelain) | ||
if (( $(echo ${#hasChanged}) != 0 )); then | ||
git status | ||
echo "There are changes in the repository" | ||
exit 1 | ||
fi | ||
test: | ||
uses: formancehq/gh-workflows/.github/workflows/golang-test.yml@main | ||
# Tests: | ||
# runs-on: "formance-runner" | ||
# needs: | ||
# - Dirty | ||
# steps: | ||
# - uses: 'actions/checkout@v4' | ||
# with: | ||
# fetch-depth: 0 | ||
# - name: Setup Env | ||
# uses: ./.github/actions/env | ||
# - run: > | ||
# earthly | ||
# --no-output | ||
# --allow-privileged | ||
# --secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY | ||
# ${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }} | ||
# +tests | ||
# env: | ||
# SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }} |
This file was deleted.
Oops, something went wrong.
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