Skip to content

Commit

Permalink
Merge pull request #650 from trheyi/main
Browse files Browse the repository at this point in the history
refactor: Update Go setup action to version 5
  • Loading branch information
trheyi committed Jul 4, 2024
2 parents dc69a23 + f44ef83 commit 7b57b6e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 29 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,6 @@ jobs:
body: 'Thank you for the PR! The db: ${{ matrix.db }} redis: ${{ matrix.redis }} mongo: ${{ matrix.mongo }} test workflow is running, the results of the run will be commented later.'
});
- name: Setup Cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Checkout Kun
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -206,6 +196,29 @@ jobs:
with:
redis-version: ${{ matrix.redis }}

- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Setup Cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: |
go mod download
cd ../kun && go mod download
cd ../xun && go mod download
cd ../gou && go mod download
cd ../v8go && go mod download
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.8.0
with:
Expand All @@ -231,11 +244,6 @@ jobs:
user: "xiang"
password: ${{ secrets.UNIT_PASS }}

- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Setup Go Tools
run: |
make tools
Expand Down
37 changes: 23 additions & 14 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ jobs:
redis: [4, 5, 6]
mongo: ["6.0"]
steps:
- name: Setup Cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Checkout Kun
uses: actions/checkout@v4
Expand Down Expand Up @@ -156,6 +147,29 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Setup Cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: |
go mod download
cd ../kun && go mod download
cd ../xun && go mod download
cd ../gou && go mod download
cd ../v8go && go mod download
- name: Start Redis
uses: supercharge/redis-github-action@1.4.0
with:
Expand Down Expand Up @@ -186,11 +200,6 @@ jobs:
user: "xiang"
password: ${{ secrets.UNIT_PASS }}

- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Setup Go Tools
run: |
make tools
Expand Down

0 comments on commit 7b57b6e

Please sign in to comment.