diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 44b9e8c..dc44af2 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -1,7 +1,7 @@ name: Commit Lint on: - workflow_call: # Trigger pro reusable workflow + workflow_call: inputs: branch: required: false @@ -21,4 +21,7 @@ on: jobs: lint-commits: - uses: gouef/github-lib-template/.github/workflows/shared_commit-lint.yml@main + runs-on: ubuntu-latest + steps: + - name: Commit lint + uses: gouef/commit-lint-action@main diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml new file mode 100644 index 0000000..f905e18 --- /dev/null +++ b/.github/workflows/contributors.yml @@ -0,0 +1,25 @@ +name: Generate contributors + +on: + schedule: + - cron: '0 0 * * 1' + pull_request: + types: [ opened, synchronize, edited ] + push: + branches: + - master + - main + - develop + - feature/** + - release/** + - test/** + - bugfix/** + +jobs: + generate-contributors: + runs-on: ubuntu-latest + steps: + - name: Generate contributors + uses: gouef/create-contributors-action@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8acf2fb..030fe71 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,13 @@ on: jobs: call-release: - uses: gouef/github-lib-template/.github/workflows/shared_release.yml@main - with: - branch: ${{ github.ref_name }} \ No newline at end of file + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Create release + uses: gouef/release-action@main + with: + branch: ${{ github.ref_name }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4c3956d..21f0c37 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,7 @@ name: Run tests and upload coverage on: + workflow_dispatch: pull_request: types: [opened, synchronize, edited] push: @@ -9,64 +10,15 @@ permissions: id-token: write contents: read -#jobs: -# test: -# uses: gouef/github-lib-template/.github/workflows/shared_tests.yml@main -# with: -# slug: ${{ github.repository }} jobs: test: name: Run tests and collect coverage runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v5 + - name: Run tests and upload to coverage + uses: gouef/go-test-with-coverage-action@main with: go-version: 1.23.4 - - - name: Install dependencies - run: go mod tidy - - - name: Run tests - run: go test -covermode=set ./... -coverprofile=coverage.txt - - - name: Check coverage file - run: cat coverage.txt - - name: Debug info - run: | - echo "Repo: ${{ github.repository }}" - - name: Test if CODECOV_TOKEN is available - run: | - if [ -z "${{ secrets.CODECOV_TOKEN }}" ]; then - echo "CODECOV_TOKEN is NOT set" - else - echo "CODECOV_TOKEN is available" - fi - - name: Debug Codecov Token - run: | - echo "Codecov Token: ${{ secrets.CODECOV_TOKEN }}" env: - GH_TOKEN: ${{ secrets.GH_PAT }} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: Debug Codecov Upload - run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} -f coverage.txt -r github.com/${{ github.repository }} - env: - GH_TOKEN: ${{ secrets.GH_PAT }} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - - name: Upload results to Codecov - uses: codecov/codecov-action@v5 - env: - GH_TOKEN: ${{ secrets.GH_PAT }} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: coverage.txt - name: ${{ github.workflow }} - fail_ci_if_error: true - verbose: true \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/Makefile b/Makefile index ca4a860..58114d5 100644 --- a/Makefile +++ b/Makefile @@ -4,4 +4,4 @@ install: go mod tidy && go mod vendor tests: - go test -v ./tests \ No newline at end of file + go test -covermode=set ./... -coverprofile=coverage.txt \ No newline at end of file