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

move to travis.com tracking #329

Closed
40 of 41 tasks
hugomrdias opened this issue Feb 12, 2019 · 9 comments
Closed
40 of 41 tasks

move to travis.com tracking #329

hugomrdias opened this issue Feb 12, 2019 · 9 comments
Assignees
Labels
exp/novice Someone with a little familiarity can pick up kind/enhancement A net-new feature or improvement to an existing feature P0 Critical: Tackled by core team ASAP

Comments

@hugomrdias hugomrdias self-assigned this Feb 12, 2019
@hugomrdias hugomrdias added kind/enhancement A net-new feature or improvement to an existing feature status/in-progress In progress exp/novice Someone with a little familiarity can pick up P0 Critical: Tackled by core team ASAP labels Feb 12, 2019
@achingbrain
Copy link
Member

@vasco-santos
Copy link
Member

I added:

And I will do js-mafmt now.

@lidel
Copy link
Member

lidel commented Feb 18, 2019

In case anyone wants to temporarily ignore windows target (but still run it), add this to .travis.yml:

  matrix:                                                                                                                                                                                                                                           
      allow_failures:                                                                                                                                                                                                                               
          - os: windows

@lidel
Copy link
Member

lidel commented Feb 19, 2019

Fun fact: Windows build fails if you have any secrets defined as env variables.
I had one (unused) secret defined from travis-ci.org times and it broke windows build without obvious error. Removing it restored Windows build. Hope this saves someone some time.

@hugomrdias
Copy link
Member Author

@lidel I have had the secrets problem in the OP troubleshooting section for a while now, maybe it's not visible enough. Should I put it same place else?

@lidel
Copy link
Member

lidel commented Feb 19, 2019

@hugomrdias Ah, indeed, my bad!

I was looking at https://github.com/ipfs/aegir#activate-travis as the source of truth. Adding "Troubleshooting Windows jobs" there will improve visibility.

@vmx
Copy link
Member

vmx commented Feb 19, 2019

I've created a script to automate the move from Jenkins to Travis a bit.

#!/bin/sh

# https://stackoverflow.com/questions/1417957/show-just-the-current-branch-in-git/1418022#1418022
branch=$(git rev-parse --abbrev-ref HEAD)
if [ ${branch} != 'master' ]; then
    echo 'Go to a clean master branch'
fi

# Check if repo is dirty
# https://stackoverflow.com/questions/3878624/how-do-i-programmatically-determine-if-there-are-uncommitted-changes/3879077#3879077
git diff-index --quiet HEAD --
if [ $? -ne 0 ]; then
    echo 'Make sure the master branch is clean'
fi

# Get most recent master
git pull

# Will automatically fail if the `enable-travis` branch already exists
git checkout -b enable-travis

git rm -r ci
cat <<EOF >.travis.yml
language: node_js
cache: npm
stages:
  - check
  - test
  - cov

node_js:
  - '10'

os:
  - linux
  - osx
  - windows

script: npx nyc -s npm run test:node -- --bail
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov

jobs:
  include:
    - stage: check
      script:
        - npx aegir commitlint --travis
        - npx aegir dep-check
        - npm run lint

    - stage: test
      name: chrome
      addons:
        chrome: stable
      script: npx aegir test -t browser -t webworker

    - stage: test
      name: firefox
      addons:
        firefox: latest
      script: npx aegir test -t browser -t webworker -- --browsers FirefoxHeadless

notifications:
  email: false
EOF

git add .travis.yml

# https://stackoverflow.com/questions/5064563/add-line-break-to-git-commit-m-from-the-command-line/5064653#5064653
git commit -F- <<EOF
chore: enable Travis for CI

Jenkins is no longer a thing, hence enable Travis.
EOF

# https://stackoverflow.com/questions/8816107/how-can-i-retrieve-the-remote-git-address-of-a-repo/8816150#8816150
reponame=$(git remote -v|grep origin|grep push|cut -d ':' -f 2|cut -d '.' -f 1)
echo 'You might want to add a build badge to the README:'
echo "[![Travis CI](https://flat.badgen.net/travis/${reponame})](https://travis-ci.com/${reponame})"

@hugomrdias
Copy link
Member Author

added troubleshooting to the readme !
cool @vmx can you make it idempotent or at least check for .travis.yml and skip? i will add cmd to run this

@vmx
Copy link
Member

vmx commented Feb 19, 2019

@hugomrdias It's semi-automatic as you'd also (probably) want to edit the README and add the badge. I'd say it's easy enough to just copy&paste this file if you want to run it, I wouldn't add it to aegir. It's a one time thing anyway.

@hugomrdias hugomrdias pinned this issue Feb 20, 2019
hacdias added a commit to ipfs-inactive/npm-go-ipfs-dep that referenced this issue Mar 4, 2019
This is part of ipfs/aegir#329.

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
@ghost ghost removed the status/in-progress In progress label May 3, 2019
@hugomrdias hugomrdias unpinned this issue May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up kind/enhancement A net-new feature or improvement to an existing feature P0 Critical: Tackled by core team ASAP
Projects
None yet
Development

No branches or pull requests

5 participants