Skip to content

Commit

Permalink
Pass secrets into workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
menghif committed Apr 11, 2022
1 parent 4ea4ca2 commit 943042b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ jobs:
# Make sure eslint passes
eslint:
uses: Seneca-CDOT/telescope/.github/workflows/eslint-ci.yml@master
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
turborepo-token: ${{ secrets.TURBO_SERVER_TOKEN }}

# Run unit tests on all platforms/versions of node
unit:
uses: Seneca-CDOT/telescope/.github/workflows/unit-tests-ci.yml@master
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
turborepo-token: ${{ secrets.TURBO_SERVER_TOKEN }}

# Run end-to-end tests along with the microservices in docker-compose on Linux
e2e:
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/eslint-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ name: ESLint Workflow

on:
workflow_call:
secrets:
github-token:
description: 'The GitHub authentication token'
required: true
turborepo-token:
description: 'The Turborepo local server token'
required: true

jobs:
# Make sure eslint passes
Expand All @@ -18,10 +25,10 @@ jobs:
- name: Turborepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ secrets.TURBO_SERVER_TOKEN }}
repo-token: ${{ secrets.github-token }}
server-token: ${{ secrets.turborepo-token }}

- name: Install dependencies and run eslint
run: |
pnpm install
pnpm turbo run lint --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}"
pnpm turbo run lint --api="http://127.0.0.1:9080" --token="${{ secrets.server-token }}"
13 changes: 10 additions & 3 deletions .github/workflows/unit-tests-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ name: Unit Tests Workflow

on:
workflow_call:
secrets:
github-token:
description: 'The GitHub authentication token'
required: true
turborepo-token:
description: 'The Turborepo local server token'
required: true

jobs:
unit:
Expand All @@ -22,10 +29,10 @@ jobs:
- name: Turborepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ secrets.TURBO_SERVER_TOKEN }}
repo-token: ${{ secrets.github-token }}
server-token: ${{ secrets.turborepo-token }}

- name: Install dependencies and run tests with default env
run: |
pnpm install
pnpm turbo run test --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}"
pnpm turbo run test --api="http://127.0.0.1:9080" --token="${{ secrets.server-token }}"

0 comments on commit 943042b

Please sign in to comment.