CircleCI Lint Test fails after I lint code locally - continuous-integration

I am new to CircleCI and working on a project that runs CirclCI on GitHub whenever code is pushed to the remote repo.
Before pushing, I run yarn lint and I still get a failing test from CircleCI.
Also, just to be clear, when I run yarn lint there are no changes that are shown in my git locally. It is green displaying no changes were made by the linting.
CircleCI HomePage:
Additional Context:
I am running a Mac and CI is running Linux.

Run yarn prettier --check . to solve this problem.

Related

getting YN0028 The lockfile would have been modified by this install, which is explicitly forbidden. using yarn berry and heroku

I'm using yarn berry and heroku and consistently getting the error:
➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.
Which suggests that my lockfile does not contain all my listed dependencies. In the yarn docs it says this is easily solved by running yarn install and pushing new lockfile to git. However I've tried this, tried with fresh node_modules, etc with no luck.
Has anyone else experienced this issue using yarn berry + heroku?
My repo is a monorepo using workspaces.
I was able to workaround by setting the env-var YARN_ENABLE_IMMUTABLE_INSTALLS to false, as suggested here.
This is likely a bug in Yarn Berry. I've reported it here: https://github.com/yarnpkg/berry/issues/2948
UPD: I have created a fresh local clone of the repo from GitHub, ran yarn install in it, and it did produce changes in yarn.lock. Committing those changes resolved the CI issue, so disabling YARN_ENABLE_IMMUTABLE_INSTALLS is no longer necessary for me.
The original local repo showed a clean git status, so I still believe it is a bug.
UPD 2: My problem was that one of the Yarn worspaces was checked into git as a git submodule (I have probably created it with a nested .git/ folder and then deleted it). As a result, the workspace content, including a child package.json was not committed into the repo, it only existed in my local repo and not on the remote and CI.
After removing the git submodule and checking the workspace into the repo properly, the YN0028 error stopped happening.
If your ENV doesn't contain any CI variables:
Then it could be your yarn config:
Run yarn config get enableImmutableInstalls and see if it's enabled.
(you can also check why it is enabled by running yarn config --why and looking for enableImmutableInstalls).
If it is true, then run yarn config set -H enableImmutableInstalls false to set the setting's value globally (or without the -H argument to set it only in your current project)
I ran across the same issue. I resolve dit by deleting my cache and then reinstalling the dependencies.
The yarn.lock file was then modified by the time the reinstall had completed.
I believe this may have been because I checked in the cache folder initially, and then reverted it. Not sure if this then caused a discrepancy between my local environment and the checked-in repo.

Error while installing Cypress: Cypress cannot run because this binary file does not have executable permissions here:

Getting an error while installing Cypress.io. I followed the steps in the documentation and still getting the following error:
Cypress cannot run because this binary file does not have executable permissions here:
/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/MacOS/Cypress
Reasons this may happen:
- node was installed as 'root' or with 'sudo'
- the cypress npm package as 'root' or with 'sudo'
Please check that you have the appropriate user permissions.
You can also try clearing the cache with 'cypress cache clear' and reinstalling.
The folder structure is app/e2e/, and basically right now only contains the yarn.lock & package.json.
Commands I ran were:
yarn init
yarn add cypress
yarn run cypress open
then tried:
sudo yarn add cypress
yarn run cypress open
still didn't work, so then I tried:
cypress cache clear
which still didn't work...
After following a few threads here on SO and some on the cypress repo, here's what helped me, and I hope it helps someone else.
In my case, I deleted the existing e2e folder(probably not needed) and then made a new e2e folder inside my app and then ran the following:
yarn init
yarn add cypress
yarn run cypress install // this was the key
yarn run cypress open
Now I get all the base files that come with a fresh install of cypress.

How do I separate [npm run watch] and [npm run prod] output (Laravel Mix context)?

I am using Laravel Mix to compile my frontend assets for development environment npm run watch and npm run prod when I am ready to push changes to GIT server and deploy to live.
The problem is when I run npm run watch my changelist gets contaminated heavily (since all the assets are uncompressed, due to obvious reasons) and I have to stop npm run watch, run npm run prod, push changes run npm and run watch again....
This is quickly got old and boring... I was considering compiling production assets on production server, but this is not possible, since we are practicing zero-downtime deployment keeping live server clean from npm packages and such.
Is there a way to actually be able to run npm run watch without interruptions, maybe publish uncompressed assets somewhere else (inject from different folder with mix() on dev), compiling production assets before git commit (automatically?!)?
This would seriously help me a lot.
Any suggestions highly appreciated!
You can add public/js/* and public/css/* to gitignore and compile what you need on the server and after runs npm run watch no file will be change affected by git.

Trouble Installing IPFS

I am using the instructions given on their site for MacOS- https://ipfs.io/docs/install/#installing-with-ipfs-update
[tutorial][1]
To build demo, clone this repo and run the following command:
$ cd contracts
$ npm install
Running the demo
To run demo, first run testrpc by running:
$ testrpc
Then compile and deploy the solidity contracts:
$ truffle compile
$ truffle migrate
Run an instance of IPFS to enable uploads:
$ ipfs daemon
Finally to build website, run:
$ npm run dev
I reached this last step (npm run dev) and I got an error message saying "npm missing scripts dev"
I am in the contracts directory specified, and installed everything there properly I believe. However, I don't see any dev script in the json package(s) which I believe could be being referenced using the npm run dev command. May this be the problem?
Here are the files wihin the folder contracts-master
app
index.html
javascripts
stylesheets
contracts
**ethpm.json** This one?
img
LICENSE
Lockup.sol
migrations
**package.json** Or this one?
Readme.md
scripts
coverage.sh
coveralls.sh
install.sh
test.sh
truffle.js
Any help / suggestions / learning resources would be appreciated.
Thanks for your time,
Elias
Your error is not because of ipfs. You are running dev mode but error saying that you don't have any scripts dev.If you are deploying smart contracts then you don't need ipfs demon. check package.json
"scripts": {
"dev": "command to run service"
}
Your package.json don't have dev scripts recheck package.json

Install cocoapods before CI integration

Trying to run a bot on my Xcode Server. The project uses cocoapods, however they are ignored via git.
So I am trying to 'pod install' for the bot integration via a script.
That looks like this:
However when I run the bot / integration I get this error:
Trigger Error Trigger exited with non-zero status 127
How can I properly run pod install for my bot?
Better if edit your .gitignore and commit Pods folder.

Resources