feat: add listingTime and narrow down marketplace returned (#829) #2620
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
lint-build-test: | |
name: Lint, build and test | |
runs-on: ubuntu-latest | |
outputs: | |
JOB_LINT: ${{ steps.lint.outcome }} | |
JOB_TEST: ${{ steps.test.outcome }} | |
JOB_BUILD: ${{ steps.build.outcome }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
cache: "npm" | |
- name: Turbo Cache | |
id: turbo-cache | |
uses: actions/cache@v3 | |
with: | |
path: .turbo | |
key: turbo-${{ runner.os }}-${{ github.sha }} | |
restore-keys: | | |
turbo-${{ runner.os }} | |
- run: npm ci | |
- id: lint | |
run: npm run lint -- --cache-dir=".turbo" | |
- id: build | |
run: npm run build -- --cache-dir=".turbo" | |
- id: test | |
run: npm run test -- --cache-dir=".turbo" | |
e2e-tests: | |
name: Run e2e tests | |
runs-on: ubuntu-22.04 | |
needs: [lint-build-test] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
token: ${{ secrets.BSNORG_ACTIONS_SECRET }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
# NOTE: Disabled until https://github.com/actions/setup-node/issues/516 is resolved | |
# cache: "npm" | |
- name: Turbo Cache | |
id: turbo-cache | |
uses: actions/cache@v3 | |
with: | |
path: .turbo | |
key: turbo-${{ runner.os }}-${{ github.sha }} | |
restore-keys: | | |
turbo-${{ runner.os }} | |
- run: npm ci | |
- name: Build | |
run: | | |
npm run build -- --cache-dir=".turbo" | |
- run: cd e2e && docker compose build && cd .. | |
# In this step, this action saves a list of existing images, | |
# the cache is created without them in the post run. | |
# It also restores the cache if it exists. | |
- uses: satackey/action-docker-layer-caching@v0.0.11 | |
# Ignore the failure of a step and avoid terminating the job. | |
continue-on-error: true | |
# Rerun the test to be able to publish all coverage reports in the same flow | |
- name: Run packages test | |
run: npm run test -- --force | |
- name: Run e2e tests | |
run: npm run e2e:suite | |
- name: Upload common package coverage | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./packages/common/coverage/coverage-final.json | |
flags: unittests,common | |
- name: Upload core-sdk package coverage | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./packages/core-sdk/coverage/coverage-final.json | |
flags: unittests,core-sdk | |
- name: Upload eth-connect-sdk package coverage | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./packages/eth-connect-sdk/coverage/coverage-final.json | |
flags: unittests,eth-connect-sdk | |
- name: Upload ethers-sdk package coverage | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./packages/ethers-sdk/coverage/coverage-final.json | |
flags: unittests,ethers-sdk | |
- name: Upload ipfs-storage package coverage | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./packages/ipfs-storage/coverage/coverage-final.json | |
flags: unittests,ipfs-storage | |
- name: Upload metadata package coverage | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./packages/metadata/coverage/coverage-final.json | |
flags: unittests,metadata | |
- name: Upload e2e tests coverage | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./e2e/coverage/coverage-final.json | |
flags: e2e | |
job-summary: | |
name: Create Job Summary | |
runs-on: ubuntu-latest | |
if: always() | |
needs: [lint-build-test] | |
env: | |
JOB_LINT: ${{ needs.lint-build-test.outputs.JOB_LINT }} | |
JOB_TEST: ${{ needs.lint-build-test.outputs.JOB_TEST }} | |
JOB_BUILD: ${{ needs.lint-build-test.outputs.JOB_BUILD }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Adding Job Summary | |
run: | | |
echo "| Command | Status |" >> $GITHUB_STEP_SUMMARY | |
echo "| ---- | ---- |" >> $GITHUB_STEP_SUMMARY | |
if [ ${{ env.JOB_LINT }} == success ]; then | |
echo "| Lint | ✅ |" >> $GITHUB_STEP_SUMMARY | |
else | |
echo "| Lint | ❌ |" >> $GITHUB_STEP_SUMMARY | |
fi | |
if [ ${{ env.JOB_TEST }} == success ]; then | |
echo "| Test | ✅ |" >> $GITHUB_STEP_SUMMARY | |
else | |
echo "| Test | ❌ |" >> $GITHUB_STEP_SUMMARY | |
fi | |
if [ ${{ env.JOB_BUILD }} == success ]; then | |
echo "| Build | ✅ |" >> $GITHUB_STEP_SUMMARY | |
else | |
echo "| Build | ❌ |" >> $GITHUB_STEP_SUMMARY | |
fi |