feat: add caching steps for checkout, Go modules, and golangci-lint in deployment workflow

This commit is contained in:
2026-01-10 16:34:43 +08:00
parent 6a46b89d54
commit fdadbc7216

View File

@@ -21,6 +21,13 @@ jobs:
uses: actions/checkout@v6
with:
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 workflow is now ready to test your code on the runner."
- name: List files in the repository
@@ -29,8 +36,22 @@ jobs:
- name: Check go version
run: |
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
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
run: |
cd ${{ gitea.workspace }}