feat: add caching steps for checkout, Go modules, and golangci-lint in deployment workflow
This commit is contained in:
@@ -21,6 +21,13 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
- name: Cache checkout
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{ gitea.workspace }}
|
||||||
|
key: ${{ runner.os }}-checkout-${{ hashFiles('**/*') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-checkout-
|
||||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
||||||
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
||||||
- name: List files in the repository
|
- name: List files in the repository
|
||||||
@@ -29,8 +36,22 @@ jobs:
|
|||||||
- name: Check go version
|
- name: Check go version
|
||||||
run: |
|
run: |
|
||||||
go version
|
go version
|
||||||
|
- name: Cache Go modules
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
- name: Run golangci-lint
|
- name: Run golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v9
|
uses: golangci/golangci-lint-action@v9
|
||||||
|
- name: Cache golangci-lint
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.cache/golangci-lint
|
||||||
|
key: ${{ runner.os }}-golangci-lint-${{ hashFiles('.golangci.yml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-golangci-lint-
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: |
|
run: |
|
||||||
cd ${{ gitea.workspace }}
|
cd ${{ gitea.workspace }}
|
||||||
|
|||||||
Reference in New Issue
Block a user