Skip to content

Commit 3e28c6e

Browse files
author
Dmytro Bondar
authored
chore: Update github actions (#477)
* Added dependabot config * Update actions, move shell-lint to separate workflow * Add workflow to delete PR cache
1 parent ba3c23d commit 3e28c6e

File tree

5 files changed

+85
-41
lines changed

5 files changed

+85
-41
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
13+
- package-ecosystem: "gomod"
14+
directory: "/"
15+
schedule:
16+
interval: "weekly"

.github/workflows/ci.yaml

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
name: CI
33

44
env:
5-
VERSION_GO: '1.20.12'
6-
VERSION_HELM: 'v3.13.3'
5+
VERSION_HELM: 'v3.11.3'
76

87
on:
98
pull_request:
@@ -17,17 +16,10 @@ jobs:
1716
if: "!contains(github.event.head_commit.message, '[ci skip]')"
1817
runs-on: ubuntu-latest
1918
steps:
20-
- uses: actions/checkout@v2
21-
- uses: actions/setup-go@v2
19+
- uses: actions/checkout@v3
20+
- uses: actions/setup-go@v4
2221
with:
23-
go-version: ${{ env.VERSION_GO }}
24-
25-
- uses: actions/cache@v2
26-
with:
27-
path: ~/go/pkg/mod
28-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29-
restore-keys: |
30-
${{ runner.os }}-go-
22+
go-version-file: 'go.mod'
3123

3224
- name: Install dependencies
3325
run: make bootstrap
@@ -73,20 +65,20 @@ jobs:
7365
git config --global core.autocrlf false
7466
git config --global core.eol lf
7567
76-
- uses: actions/checkout@v2
68+
- uses: actions/checkout@v3
7769

7870
- name: Setup Helm
79-
uses: azure/setup-helm@v1.1
71+
uses: azure/setup-helm@v3
8072
with:
8173
version: ${{ env.VERSION_HELM }}
8274

8375
- name: Setup WSL
8476
if: "contains(matrix.shell, 'wsl')"
85-
uses: Vampire/setup-wsl@v1
77+
uses: Vampire/setup-wsl@v2
8678

8779
- name: Setup Cygwin
8880
if: "contains(matrix.shell, 'cygwin')"
89-
uses: egor-tensin/setup-cygwin@v3
81+
uses: egor-tensin/setup-cygwin@v4
9082
with:
9183
platform: x64
9284

@@ -103,10 +95,10 @@ jobs:
10395
with:
10496
version: "v0.11.1"
10597

106-
- uses: actions/checkout@v2
98+
- uses: actions/checkout@v3
10799

108100
- name: Setup Helm
109-
uses: azure/setup-helm@v1.1
101+
uses: azure/setup-helm@v3
110102
with:
111103
version: ${{ env.VERSION_HELM }}
112104

@@ -124,15 +116,3 @@ jobs:
124116

125117
- name: helm diff upgrade -C 3 --set replicaCount=2 --install helm-diff ./helm-diff
126118
run: helm diff upgrade -C 3 --set replicaCount=2 --install helm-diff ./helm-diff
127-
128-
shell-lint:
129-
name: Lint install-binary.sh
130-
runs-on: ubuntu-latest
131-
if: "!contains(github.event.head_commit.message, '[ci skip]')"
132-
continue-on-error: true
133-
steps:
134-
- uses: actions/checkout@v2.4.0
135-
- uses: luizm/action-sh-checker@v0.3.0
136-
with:
137-
sh_checker_exclude: "scripts"
138-
sh_checker_checkbashisms_enable: true

.github/workflows/cleanup.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Cleanup
3+
4+
on:
5+
pull_request:
6+
types:
7+
- closed
8+
9+
jobs:
10+
cleanup-cache:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: 'Cleanup PR cache'
14+
run: |
15+
gh extension install actions/gh-actions-cache
16+
17+
REPO="${{ github.repository }}"
18+
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
19+
20+
echo "Fetching list of cache key"
21+
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
22+
23+
## Setting this to not fail the workflow while deleting cache keys.
24+
set +e
25+
echo "Deleting caches..."
26+
for cacheKey in $cacheKeysForPR
27+
do
28+
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
29+
done
30+
echo "Done"
31+
shell: bash
32+
env:
33+
GH_TOKEN: ${{ github.token }}

.github/workflows/lint-sh.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint sh
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths: ['install-binary.sh']
7+
pull_request:
8+
branches: [master]
9+
paths: ['install-binary.sh']
10+
11+
jobs:
12+
lint-sh:
13+
name: Lint install-binary.sh
14+
runs-on: ubuntu-latest
15+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
16+
continue-on-error: true
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: luizm/action-sh-checker@v0.7.0
20+
with:
21+
sh_checker_exclude: 'scripts'
22+
sh_checker_checkbashisms_enable: true

.github/workflows/lint.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,16 @@ on:
99
branches: [ master ]
1010
paths-ignore: [ '**.md' ]
1111

12-
env:
13-
GO_VERSION: 1.19
14-
1512
jobs:
1613
lint:
1714
name: Lint
1815
runs-on: ubuntu-latest
1916
timeout-minutes: 10
2017
steps:
21-
- uses: actions/setup-go@v3
18+
- uses: actions/checkout@v3
19+
- uses: actions/setup-go@v4
2220
with:
23-
go-version: '1.19'
24-
25-
- name: Checkout code
26-
uses: actions/checkout@v3
27-
28-
- name: Golangci lint
29-
uses: golangci/golangci-lint-action@v3
21+
go-version-file: 'go.mod'
22+
- uses: golangci/golangci-lint-action@v3
3023
with:
3124
version: v1.51.0

0 commit comments

Comments
 (0)