Skip to content

Commit

Permalink
Update PR workflow (subquery#2312)
Browse files Browse the repository at this point in the history
* Update PR workflow

* Update yarn to 3.2.4

* Disable coverage comparison

* Add report json to artifacts

* Bring back report file

* Revert change
  • Loading branch information
stwiname authored Mar 20, 2024
1 parent be43bba commit c2db455
Show file tree
Hide file tree
Showing 7 changed files with 862 additions and 778 deletions.
57 changes: 53 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
paths-ignore:
- '.github/workflows/**'
jobs:
pr:
name: pr
code-style:
name: code-style
runs-on: ubuntu-latest
env:
SUBQL_ACCESS_TOKEN: ${{ secrets.SUBQL_ACCESS_TOKEN }}
Expand All @@ -24,6 +24,55 @@ jobs:
run: yarn pretty-quick --check --pattern 'packages/*/src/**/*' --branch origin/main
- name: lint
run: yarn lint
- name: test
run: yarn test:docker

coverage:
name: Coverage report
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DB_USER: postgres
DB_PASS: postgres
DB_DATABASE: postgres
DB_HOST: localhost
DB_PORT: 5432
steps:
- uses: actions/checkout@v4

- name: Use Node 18
uses: actions/setup-node@v4
with:
node-version: 18

- name: install dependencies
run: yarn

- name: build
run: yarn build

- uses: artiomtr/jest-coverage-report-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-step: install
package-manager: yarn
working-directory: .
test-script: yarn test:ci
annotations: none
# coverage-file: report.json
base-coverage-file: report-main.json

- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: report.json
768 changes: 0 additions & 768 deletions .yarn/releases/yarn-3.1.1.cjs

This file was deleted.

801 changes: 801 additions & 0 deletions .yarn/releases/yarn-3.2.4.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"

yarnPath: .yarn/releases/yarn-3.1.1.cjs
yarnPath: .yarn/releases/yarn-3.2.4.cjs
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"build": "yarn workspaces foreach -ptA run build",
"lint": "eslint packages --ext .ts",
"test": "jest --coverage",
"test:ci": "jest --testRegex='.*\\.(spec|test)\\.ts$'",
"test:all": "node --expose-gc ./node_modules/.bin/jest --logHeapUsage --testRegex='.*\\.(spec|test)\\.ts$' --forceExit --ci -w=2 --clearMocks",
"test:docker": "docker-compose -f test/docker-compose.yaml up --remove-orphans --abort-on-container-exit --build test",
"postinstall": "husky install"
Expand All @@ -57,5 +58,5 @@
"prettier --write"
]
},
"packageManager": "yarn@3.1.1"
"packageManager": "yarn@3.2.4"
}
1 change: 1 addition & 0 deletions report-main.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Manual changes might be lost - proceed with caution!

__metadata:
version: 5
version: 6
cacheKey: 8

"@actions/core@npm:^1.10.0":
Expand Down Expand Up @@ -17209,7 +17209,7 @@ __metadata:
version: 3.0.0
resolution: "native-fetch@npm:3.0.0"
peerDependencies:
node-fetch: 2.6.7
node-fetch: "*"
checksum: eec8cc78d6da4d0f3f56055e3e557473ac86dd35fd40053ea268d644af7b20babc891d2b53ef821b77ed2428265f60b85e49d754c555de89bfa071a743b853bb
languageName: node
linkType: hard
Expand Down Expand Up @@ -21780,7 +21780,7 @@ __metadata:

"typescript@patch:typescript@>=5.2.2#~builtin<compat/typescript>":
version: 5.2.2
resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin<compat/typescript>::version=5.2.2&hash=493e53"
resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin<compat/typescript>::version=5.2.2&hash=701156"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
Expand All @@ -21790,7 +21790,7 @@ __metadata:

"typescript@patch:typescript@^4.9.5#~builtin<compat/typescript>":
version: 4.9.5
resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin<compat/typescript>::version=4.9.5&hash=493e53"
resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin<compat/typescript>::version=4.9.5&hash=701156"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
Expand Down

0 comments on commit c2db455

Please sign in to comment.