Skip to content

Commit

Permalink
Improvements to GHA (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
gab-arrobo authored May 3, 2024
1 parent 3da530b commit bdef45b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 14 deletions.
5 changes: 3 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2024 Canonical Ltd.
# Copyright 2024 Intel Corporation

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
24 changes: 12 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2024 Canonical Ltd.
# Copyright 2024 Intel Corporation

name: Main workflow

Expand All @@ -24,7 +24,7 @@ jobs:
- name: Build
run: go build ./...

unit-tests:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -33,9 +33,12 @@ jobs:
with:
go-version-file: 'go.mod'

- name: Unit tests
run: go test ./...

- name: golangci-lint
uses: golangci/[email protected]
with:
version: latest
args: -v --config ./.golangci.yml

license-check:
runs-on: ubuntu-latest
steps:
Expand All @@ -53,8 +56,8 @@ jobs:
uses: fossa-contrib/fossa-action@v3
with:
fossa-api-key: 0c3bbcdf20e157bbd487dae173751b28
lint:
name: lint

unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -63,8 +66,5 @@ jobs:
with:
go-version-file: 'go.mod'

- name: golangci-lint
uses: golangci/[email protected]
with:
version: latest
args: -v --config ./.golangci.yml
- name: Unit tests
run: go test ./...
25 changes: 25 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2024 Intel Corporation
name: Stale issue/pr

on:
schedule:
- cron: "0 0 * * *"

env:
DAYS_BEFORE_STALE: 120
DAYS_BEFORE_CLOSE: 15

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue has been stale for ${{ env.DAYS_BEFORE_STALE }} days and will be closed in ${{ env.DAYS_BEFORE_CLOSE }} days. Comment to keep it open.'
stale-pr-message: 'This pull request has been stale for ${{ env.DAYS_BEFORE_STALE }} days and will be closed in ${{ env.DAYS_BEFORE_CLOSE }} days. Comment to keep it open.'
stale-issue-label: 'stale/issue'
stale-pr-label: 'stale/pr'
days-before-stale: ${{ env.DAYS_BEFORE_STALE }}
days-before-close: ${{ env.DAYS_BEFORE_CLOSE }}

0 comments on commit bdef45b

Please sign in to comment.