Skip to content

Commit

Permalink
fix(repo): Test envs
Browse files Browse the repository at this point in the history
  • Loading branch information
tmilewski committed Oct 26, 2023
1 parent 096ce7b commit c5e7971
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
42 changes: 22 additions & 20 deletions .github/actions/init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,45 +43,47 @@ runs:
- name: Configure Turborepo
id: turbo
uses: actions/github-script@v6
env:
ENABLED: ${{ inputs.turbo-enabled }}
CACHE_DIR: ${{ inputs.turbo-cache-dir }}
SIGNATURE: ${{ inputs.turbo-signature }}
REMOTE_ONLY: ${{ inputs.turbo-remote-only }}
TEAM: ${{ inputs.turbo-team }}
TOKEN: ${{ inputs.turbo-token }}
with:
result-encoding: string
script: |
const os = require('os')
const cpus =
typeof os.availableParallelism === "function"
? os.availableParallelism()
: os.cpus().length;
const turbo = {
enabled: core.getInput('turbo-enabled') === 'true',
cacheDir: core.getInput('turbo-cache-dir'),
signature: core.getInput('turbo-signature'),
remoteOnly: core.getInput('turbo-remote-only'),
team: core.getInput('turbo-team', { required: true }),
token: core.getInput('turbo-token', { required: true }),
}
const { ENABLED, CACHE_DIR, SIGNATURE, REMOTE_ONLY, TURBO_TEAM, TOKEN } = process.env
const turboArgs = [
'--output-logs=new-only',
`--cache-dir=${turbo.cacheDir}`,
`--cache-dir=${CACHE_DIR}`,
`--concurrency=${cpus}`
];
if (turbo.enabled) {
turboArgs.push(
`--team=${turbo.team}`,
`--token=${turbo.token}`,
`--remote-only=${turbo.remoteOnly}`,
)
if (ENABLED === 'true') {
core.exportVariable('TURBO_TEAM', TEAM)
core.exportVariable('TURBO_TOKEN', TOKEN)
core.exportVariable('TURBO_REMOTE_CACHE_SIGNATURE_KEY', REMOTE_ONLY)
// turboArgs.push(
// `--team=${TEAM}`,
// `--token=${TOKEN}`,
// `--remote-only=${REMOTE_ONLY}`,
// )
}
if (SIGNATURE && SIGNATURE !== '') {
core.exportVariable('TURBO_REMOTE_CACHE_SIGNATURE_KEY', SIGNATURE)
}
core.setOutput('turbo-args', turboArgs.join(' '));
core.exportVariable('FORCE_COLOR', '1')
if (turbo.signature && turbo.signature !== '') {
core.exportVariable('TURBO_REMOTE_CACHE_SIGNATURE_KEY')
}
- name: Setup NodeJS ${{ inputs.node-version }}
uses: actions/setup-node@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ jobs:
turbo-team: ${{ vars.TURBO_TEAM }}
turbo-token: ${{ secrets.TURBO_TOKEN }}

- name: Test Envs
run: |
console.log('TURBO_TEAM: ${{ env.TURBO_TEAM }}')
- name: Require Changeset
run: if [ "${{ github.event.pull_request.user.login }}" = "clerk-cookie" ]; then echo 'Skipping' && exit 0; else npx changeset status --since=origin/main; fi

Expand Down

0 comments on commit c5e7971

Please sign in to comment.