Closed NorkzYT closed 1 year ago
Hi, What is your build script does?
The output of the Build
is displayed below.
Run yarn build --api="http://127.0.0.1:9080" --token="***" --team="team_name"
yarn build --api="http://127.0.0.1:9080" --token="***" --team="team_name"
shell: /usr/bin/bash -e {0}
yarn run v1.22.19
warning team_name@0.0.0: The engine "pnpm" appears to be invalid.
$ next build --api=http://127.0.0.1:9080 --token=*** --team=team_name
Unknown or unexpected option: --api
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.
I am going to change the Build
based on the new README.md
changes, will advise.
It is not related to the new (env vars usage) feature.
I think that your yarn build
doesn't uses turborepo command.
Understood, I changed the command.
I now receive the following output.
Run yarn build-turbo
yarn run v1.22.19
warning repository@0.0.0: The engine "pnpm" appears to be invalid.
$ turbo run build
• Running build
build: ERROR: command finished with error: exec: "pnpm": executable file not found in $PATH
• Remote caching disabled
exec: "pnpm": executable file not found in $PATH
ERROR run failed: command exited (1)
build: cache miss, executing f257ee3b340b7d93
Tasks: 0 successful, 1 total
Cached: 0 cached, 1 total
Time: 322ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.
I am thinking the pnpm
error is due to the following in my package.json
file.
"engines": {
"pnpm": ">=7.17.0",
"npm": ">=7.10.0",
"node": ">=16.0.0"
}
Yarn is not installed, I am going to change the yarn
command to pnpm
.
Is it working on the local? the error is not related to this lib.
I fixed the Github action by setting upPNPM
instead of Yarn
.
The following yml
contains the contents of the currently working PNPM
TurboRepo GitHub Artifacts Action
.
name: TurboRepo Github Artifacts action
on:
workflow_dispatch:
push:
branches:
- main
jobs:
turborepo-github-artifacts-action:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Packages
run: pnpm install --frozen-lockfile
env:
CI: true
- name: Turborepo local server
uses: felixmosh/turborepo-gh-artifacts@v2
with:
repo-token: ${{ secrets.TOKEN_TURBOREPO }} # GITHUB_TOKEN
server-token: ${{ secrets.TURBO_SERVER_TOKEN }}
- name: Build
run: pnpm run build-turbo
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: 'foo'
By following the instructions in the example repository, will I be able to connect to the GitHub Artifacts Turbo Repo Cache?
https://github.com/felixmosh/turborepo-gh-artifacts-example#remote-caching
What do you mean? this is what the lib does, proxy between turborepo remote-cache feature to Github Artifacts in order to save build artifacts there.
Understood. Every time I run the build-turbo
command, will it automatically connect to the GitHub TurboRepo Cache when running it with the following parameters?
turbo run build --api="https://my-server.example.com" --token="xxxxxxxxxxxxxxxxx"
Yeah :] This is the whole point, the flow is as the following:
Now, if you will build the same app (which should produce the same cache artifacts), turbo repo will download the artifacts using this lib from GithubArtifacts, and reuse it. (won't build them at all)
Understood, thank you very much for the explanation.
Hello, hope you are having a wonderful day.
I copied https://github.com/felixmosh/turborepo-gh-artifacts-example/blob/master/.github/workflows/test.yaml, and ran it with the requirements this repositories
README.md
says, I receiveUnknown or unexpected option: --api
duringBuild
. Could someone please assist me with this setup as I am certain it is incorrect?The
TurboRepo.yml
file contents are displayed below.