Many(/most?) test frameworks have some kind of flag system build in to disable some tests/suites based on an environmental variable. So you can enable or disable when env is set to ci. Have done it from time to time.
Generally I prefer tests to run pre-commit during dev; then again when the PR is raised (blocking merge if they fail); then again after merge to master. Releases are done off master with a check for a green build.