Skip to content

Commit

Permalink
Merge pull request #124 from web3-storage/fixing-denylist-tests
Browse files Browse the repository at this point in the history
fix: denylist tests and logging
  • Loading branch information
jsdevel authored Dec 9, 2022
2 parents 637bf20 + 82e3eaa commit be5f39d
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 1 deletion.
107 changes: 107 additions & 0 deletions .github/workflows/denylist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: denylist
on:
push:
branches:
- main
paths:
- 'packages/denylist/**'
- '.github/workflows/denylist.yml'
- 'pnpm-lock.yaml'
pull_request:
paths:
- 'packages/denylist/**'
- '.github/workflows/denylist.yml'
- 'pnpm-lock.yaml'
jobs:
check:
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
with:
version: 6.32.x
- uses: actions/setup-node@v2
- run: pnpm install
- run: pnpm build:denylist
- name: Lint
run: pnpm lint
test:
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
with:
version: 6.32.x
- uses: actions/setup-node@v2
- run: pnpm install
- run: pnpm test:denylist
deploy-staging:
name: Deploy Staging
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
with:
version: 6.32.x
- uses: actions/setup-node@v2
with:
cache: 'pnpm'
- run: pnpm install
- name: Publish app
uses: cloudflare/wrangler-action@2.0.0
env:
ENV: 'staging' # inform the build process what the env is
SENTRY_TOKEN: ${{secrets.SENTRY_TOKEN}}
SENTRY_UPLOAD: ${{ secrets.SENTRY_UPLOAD }}
with:
apiToken: ${{secrets.CF_GATEWAY_TOKEN }}
workingDirectory: 'packages/denylist'
environment: 'staging'
changelog:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Release
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.tag-release.outputs.releases_created }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: tag-release
with:
path: packages/denylist
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
monorepo-tags: true
package-name: denylist
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changelog.outputs.releases_created
name: Release
runs-on: ubuntu-latest
needs:
- check
- test
- changelog
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
with:
version: 6.32.x
- uses: actions/setup-node@v2
with:
cache: 'pnpm'
node-version: 16
registry-url: 'https://registry.npmjs.org'
- run: pnpm install
- name: Deploy
uses: cloudflare/wrangler-action@2.0.0
env:
ENV: 'production' # inform the build process what the env is
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
SENTRY_UPLOAD: ${{ secrets.SENTRY_UPLOAD }}
with:
apiToken: ${{ secrets.CF_GATEWAY_TOKEN }}
workingDirectory: 'packages/denylist'
environment: 'production'
1 change: 0 additions & 1 deletion packages/denylist/src/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export function envAll (request, env, ctx) {
env.COMMITHASH = COMMITHASH
env.SENTRY_RELEASE = SENTRY_RELEASE
env.sentry = getSentry(request, env, ctx)
env.log.time('request')
}

/**
Expand Down

0 comments on commit be5f39d

Please sign in to comment.