Skip to content

Commit

Permalink
chore: Update GitHub Actions version to v6 for pr-test.yml and unit-t…
Browse files Browse the repository at this point in the history
…est.yml workflows
  • Loading branch information
trheyi committed May 11, 2024
1 parent 5de7e73 commit 34a8b1a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,22 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
matrix:
go: [1.18.2]
db: [MySQL8.0, MySQL5.7, MySQL5.6, Postgres9.6, Postgres14.0, SQLite3]
steps:
- name: "Download artifact"
uses: actions/github-script@v3.1.0
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
var download = await github.actions.downloadArtifact({
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
Expand All @@ -46,14 +45,14 @@ jobs:
echo NR=$(cat NR) >> $GITHUB_ENV
- name: "Comment on PR"
uses: actions/github-script@v3
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { NR } = process.env
var fs = require('fs');
var issue_number = NR;
await github.issues.createComment({
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
Expand All @@ -66,7 +65,7 @@ jobs:
kind: "${{ matrix.db }}"
db: "xun"
user: "xun"
password: ${{ secrets.UNIT_PASS }}
password: "123456"

- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v3
Expand All @@ -86,7 +85,7 @@ jobs:
- name: Run Test
env:
PASSWORD: ${{ secrets.UNIT_PASS }}
PASSWORD: "123456"
# POSTGRES_DSN: ${{ secrets.UNIT_POSTGRES_DSN }}
run: |
make vet
Expand All @@ -107,16 +106,16 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos

- name: "Comment on PR"
uses: actions/github-script@v3
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { NR } = process.env
var fs = require('fs');
var issue_number = NR;
await github.issues.createComment({
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: '✨DONE✨ GO:${{ matrix.go }} DB:${{ matrix.db }} passed.'
});
body: '✨DONE✨ GO:${{ matrix.go }} DB:${{ matrix.db }} passed.'
});
4 changes: 2 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
kind: "${{ matrix.db }}"
db: "xun"
user: "xun"
password: ${{ secrets.UNIT_PASS }}
password: "123456"

- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v3
Expand All @@ -43,7 +43,7 @@ jobs:
- name: Run Test
env:
PASSWORD: ${{ secrets.UNIT_PASS }}
PASSWORD: "123456"
# POSTGRES_DSN: ${{ secrets.UNIT_POSTGRES_DSN }}
run: |
make vet
Expand Down

0 comments on commit 34a8b1a

Please sign in to comment.