Skip to content

Commit

Permalink
chore: Per build API secrets (#60)
Browse files Browse the repository at this point in the history
- Per build API secrets to avoid race conditions in tests
  • Loading branch information
nadeesha authored Jan 12, 2024
1 parent a1bd0d4 commit 4984410
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/test-and-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,24 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: '0' # fetch all history for all tags and branches so that changeset-builder can generate changelogs
fetch-depth: "0" # fetch all history for all tags and branches so that changeset-builder can generate changelogs

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
scope: '@differentialhq'
registry-url: "https://registry.npmjs.org"
scope: "@differentialhq"

- name: Install dependencies on root
run: npm install

- name: Set DIFFERENTIAL_API_SECRET
run: echo "DIFFERENTIAL_API_SECRET=$(curl https://api.differential.dev/demo/token)" >> $GITHUB_ENV

- name: Run tests
run: npx lerna run test
env:
DIFFERENTIAL_API_SECRET: ${{ secrets.DIFFERENTIAL_API_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
JWKS_URL: ${{ secrets.JWKS_URL }}

Expand Down Expand Up @@ -67,4 +69,4 @@ jobs:
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: cd control-plane && flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ jobs:
- name: Install dependencies
run: npm install

- name: Set DIFFERENTIAL_API_SECRET
run: echo "DIFFERENTIAL_API_SECRET=$(curl https://api.differential.dev/demo/token)" >> $GITHUB_ENV

- name: Run tests
run: npx lerna run test
env:
DIFFERENTIAL_API_SECRET: ${{ secrets.DIFFERENTIAL_API_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
JWKS_URL: ${{ secrets.JWKS_URL }}
DEBUG: "differential:*"
Expand Down

0 comments on commit 4984410

Please sign in to comment.