Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Actions CI #286

Closed
bahmutov opened this issue Aug 8, 2019 · 14 comments · Fixed by #320
Closed

Add GitHub Actions CI #286

bahmutov opened this issue Aug 8, 2019 · 14 comments · Fixed by #320
Assignees
Labels

Comments

@bahmutov
Copy link
Contributor

bahmutov commented Aug 8, 2019

To show how to run Cypress e2e tests using the new GitHub Actions CI

  • record to Dashboard
  • run several containers in parallel
@kieranklaassen
Copy link

Would love to see GitHub actions CI implemented on the repo!

@bahmutov
Copy link
Contributor Author

bahmutov commented Sep 3, 2019

@amirrustam was working on it, seems actions are still missing proper NPM caching and also the environment variables for parallel runs are somewhat tricky

@amirrustam
Copy link
Contributor

Working closely with GH team to on this that will potentially improve some of these beta-level wrinkles for everyone.

@HugoGresse
Copy link

I was smoothly able to record on dashboard with the new Github Actions
see https://github.com/HugoGresse/open-feedback/blob/master/.github/workflows/test-e2e.yml
I have not tried the parallelization though.

@csi-lk
Copy link

csi-lk commented Sep 30, 2019

Also have setup a really simplistic version here

@mikecousins
Copy link

Any idea how to get an environment variable from Github Actions that we can use for --ci-build-id?

@HugoGresse
Copy link

@mikecousins you can setup env var from the Github repo settings ans use them like so:

    - name: npm install, build
      run: |
        npm install
        npm run build --token ${{ secrets.REACT_APP_API_KEY }}
      env:
        CI: true
        REACT_APP_API_KEY: ${{ secrets.E2E_FIREBASE_API_KEY }}

@mikecousins
Copy link

mikecousins commented Oct 4, 2019

Yeah but we need something unique on every run like a build id, build number, etc. Closest I can see in Github is the commit sha, but then it's not re-runnable.

@jbolda
Copy link

jbolda commented Oct 6, 2019

I have got it pushing into cypress with parallel, but it doesn't seem to connect back and pass the checks to the github integration. I have set a few of the git related env vars that don't seem to fill in, but it still seems to be missing something. I have an open PR that I am working through switching from Travis CI recording to Github Actions. Below are the env vars I have set so far. COMMIT_INFO_BRANCH because it seems to return null every time, and COMMIT_INFO_REMOTE because it doesn't end with .git, which may or may not be a problem.

        COMMIT_INFO_BRANCH: ${{ github.head_ref }}
        COMMIT_INFO_REMOTE: https://github.com/${{ github.repository }}.git

@mikecousins
Copy link

What are you using for your --ci-build-id @jbolda?

@jbolda
Copy link

jbolda commented Oct 11, 2019

Basically just the commit sha because as you mentioned, don't seem to have any other choice. I thought about maybe trying to grab a timestamp, but didn't want to reinvent the wheel if a better option might be coming.

@amirrustam
Copy link
Contributor

Depending on your setup, commit sha is not the really the most unique CI build id, and might lead to issues. You could generate a UUID for each run instead.

@bahmutov
Copy link
Contributor Author

bahmutov commented Nov 5, 2019

Related: cypress-io/cypress#5609

@bahmutov
Copy link
Contributor Author

🎉 This issue has been resolved in version 1.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants