Coder Social home page Coder Social logo

ci's Introduction

Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our official announcement

Atom Package CI Scripts

Templates for building your Atom package and running its specs:

Setting up CI for your package

GitHub Actions

  • Copy .github/workflows/main.yml to the same location in your package's repository tree
  • 💥 Your package will now build and run its specs; you can see an example of a configured package here

Travis CI

  • Sign up for an account on Travis CI
  • Copy .travis.yml to the root of your package's repository
  • Setup the Travis CI hook on your package's repository
  • 💥 Your package will now build and run its specs; you can see an example of a configured package here

Appveyor

  • Sign up for an account on Appveyor
  • Add a new project
  • Ensure the Ignore appveyor.yml setting in Settings > General is unchecked
  • Copy appveyor.yml to the root of your package's repository
  • 💥 Your package will now build and run its specs; you can see an example of a configured package here

CircleCI

  • Sign up for an account on CircleCI
  • Create a .circleci directory at the root of your project
  • Copy config.yml to the new directory
  • Commit the changes and push them up to GitHub
  • Add a new project on CircleCI
  • 💥 Your package will now build and run its specs; you can see an example of a configured package here

FAQ

How do I install other Atom packages that my package build depends on?

Set the APM_TEST_PACKAGES environment variable in your CI configuration file to a space-separated list of packages to install before your package's tests run.

env:
  - APM_TEST_PACKAGES="autocomplete-plus some-other-package-here"

What version of Atom is used to run the specs?

It will always download the latest available version. You can read more about the latest Atom release here.

How does it work?

The apm test command assumes your package is using Jasmine specs. You can run the specs locally using Atom's spec runner UI from the View > Developer > Run Package Specs menu or by pressing cmd-ctrl-alt-p. You can run apm help test to learn more about that command.

GitHub Actions

The CI template uses the Atom setup Action to install and set up Atom on a runner. The script then installs dependencies from your package and runs the apm test command to run your package's specs.

Travis CI, CircleCI

The CI template downloads the build-package.sh from this repository. This script then downloads the latest Atom release, installs your package's dependencies, and runs the apm test command to run your package's specs.

Appveyor

The appveyor.yml template uses Chocolatey to download and install the latest version of Atom. apm install is run in your package directory to ensure any node dependencies are available. Finally, the script runs the apm test command to run your package's specs.

What does the output look like?

What packages use this?

ci's People

Contributors

50wliu avatar arcanemagus avatar binarymuse avatar damieng avatar darangi avatar daviwil avatar felicianotech avatar fscherwi avatar jasonrudolph avatar joefitzgerald avatar kevinji avatar kevinsawicki avatar kn1kn1 avatar lee-dohm avatar levlaz avatar markushedvall avatar maxbrunsfeld avatar mnquintana avatar peterdavehello avatar sadick254 avatar smashwilson avatar stdavis avatar steelbrain avatar thomasjo avatar thumperward avatar tnm avatar tonylukasavage avatar torn4dom4n avatar uzitech avatar xfq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ci's Issues

CI on circleci - Linux

I was trying to get circleci + atom testing for my package.
I came across this issue when trying to use the yml file given here. The wget to install ato is throwing the error. It says Unable to establish SSL connection. Action failed: wget -O atom-amd64.deb https://atom.io/download/deb

Which is very weird because:

  • The link works from a browser
  • The wget command works on my computer
  • The Internet on the circleci instance doesnt seem to have any problem (pip works)

Any clue as to why it fails ? I tried sshing into it - it kept giving the same error. Tried http://atom.io/download/deb (http instead of https) also - same error.

https://circleci.com/gh/coala-analyzer/coala-atom/2#tests

(CircleCI) sh: 117: Syntax error: end of file unexpected (expecting "fi")

Failing build: https://circleci.com/gh/viddo/atom-textual-velocity/3

atom/ci/build-package.sh#L117 is the eslint clause, but can't see any obvious error there., just to rule that out also tried to removed all eslint-related stuff, but it still fails with same error output, see https://circleci.com/gh/viddo/atom-textual-velocity/5

Tried to rebuild using SSH enabled, so I could retry manually on the machine, but didn't manage to reproduce it. First time it stops due to not finding the specs:

ubuntu@box158:~$ curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh
…
Installing modules ✓
Missing spec folder! Please consider adding a test suite in './spec'

So cd into the dir that contains the source, re-running the build script there the specs run:

# cd to the existing dir which seems to contain the checked out code and rerun the build script there the tests work…:
ubuntu@box158:~$ cd atom-textual-velocity/
ubuntu@box158:~/atom-textual-velocity$ ls
appveyor.yml  atom-amd64.deb  CHANGELOG.md  circle.yml  CONTRIBUTING.md  decls  docs  keymaps  lib  LICENSE.md  node_modules  package.json  README.md  spec  styles
ubuntu@box158:~/atom-textual-velocity$ curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh
Downloading latest Atom release...
…
Installing modules ✓
Running specs...
[23239:0920/104912:ERROR:browser_main_loop.cc(217)] Running without the SUID sandbox! See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the sandbox on.
Xlib:  extension "RANDR" missing on display ":99".
Xlib:  extension "RANDR" missing on display ":99".
[23239:0920/104919:INFO:CONSOLE(52)] "Window load time: 5960ms", source: file:///usr/share/atom/resources/app.asar/static/index.js (52)
......

Any ideas of what might be wrong or suggestions on how to troubleshoot this further?

CircleCI 2.0 Example

CircleCI 2.0 is in beta testing currently. I have access to it and have found it incredibly useful for a few repos so far where setting up the required external dependencies would have proven very difficult on either Travis-CI or CircleCI's default images.

I would just submit a PR with an example configuration, but I'm not sure how to do so without confusing people new to CI (the supposed target of this repo) by having two different configurations for CircleCI, one of which likely doesn't work for them.

Does anyone have a good idea on how to handle this? Will a clear README be sufficient?

build-package.sh erroring with new TravisCI default distro

For Travis CI, the default distro of Trusty is currently being phased out in favor of Xenial. When testing a package on Xenial in Travis:

Running specs...
/home/travis/atom/usr/share/atom/atom: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
The command "curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh" exited with 127.

When I check for Atom's library links, I hit:

ldd `which atom`
not a dynamic executable

so I cannot seem to determine myself if this is a link target issue for Atom, or if a dependency needs to be added for TravisCI.

Thanks for any assistance/fix.

Install node with npm ci

Since node 5.7, they have introduce npm ci which installs from package-lock instead of upgrading on semver.

This would maintain the CI's version and speed up build time.

Add Default coffeelint.json That Matches Core Team's Definition For Idiomatic Atom CoffeeScript

Here's a starting point. I think we need a few custom rules, to allow the following to be enabled:

  • no unnecessary double quotes (except in files ending in -spec)
  • non-empty constructor needs parens (except when an argument is a multi-line function)
  • no implicit parens (except in requires and spec matchers)
  • no implicit braces (except when spanning multiple lines)
{
    "arrow_spacing": {
        "level": "error"
    },
    "camel_case_classes": {
        "level": "error"
    },
    "coffeescript_error": {
        "level": "error"
    },
    "colon_assignment_spacing": {
        "level": "error",
        "spacing": {
            "left": 0,
            "right": 1
        }
    },
    "cyclomatic_complexity": {
        "value": 10,
        "level": "ignore"
    },
    "duplicate_key": {
        "level": "error"
    },
    "empty_constructor_needs_parens": {
        "level": "ignore"
    },
    "ensure_comprehensions": {
        "level": "warn"
    },
    "indentation": {
        "value": 2,
        "level": "error"
    },
    "line_endings": {
        "level": "ignore",
        "value": "unix"
    },
    "max_line_length": {
        "value": 80,
        "level": "ignore",
        "limitComments": true
    },
    "missing_fat_arrows": {
        "level": "ignore"
    },
    "newlines_after_classes": {
        "value": 3,
        "level": "ignore"
    },
    "no_backticks": {
        "level": "error"
    },
    "no_debugger": {
        "level": "error"
    },
    "no_empty_functions": {
        "level": "error"
    },
    "no_empty_param_list": {
        "level": "error"
    },
    "no_implicit_braces": {
        "level": "ignore",
        "strict": false
    },
    "no_implicit_parens": {
        "strict": false,
        "level": "ignore"
    },
    "no_interpolation_in_single_quotes": {
        "level": "warn"
    },
    "no_plusplus": {
        "level": "error"
    },
    "no_stand_alone_at": {
        "level": "error"
    },
    "no_tabs": {
        "level": "error"
    },
    "no_throwing_strings": {
        "level": "error"
    },
    "no_trailing_semicolons": {
        "level": "error"
    },
    "no_trailing_whitespace": {
        "level": "error",
        "allowed_in_comments": false,
        "allowed_in_empty_lines": true
    },
    "no_unnecessary_double_quotes": {
        "level": "ignore"
    },
    "no_unnecessary_fat_arrows": {
        "level": "warn"
    },
    "non_empty_constructor_needs_parens": {
        "level": "ignore"
    },
    "prefer_english_operator": {
        "level": "error",
        "doubleNotLevel": "ignore"
    },
    "space_operators": {
        "level": "error"
    },
    "spacing_after_comma": {
        "level": "error"
    },
    "transform_messes_up_line_numbers": {
        "level": "warn"
    }
}

Appveyor build pulls in ia32 version of Node despite x64 env

I'm working on a PR to package up golint in linter-golinter. It's runs fine in Travis and CircleCI but fails in Appveyor. The error has to do with cross-compilation.

For whatever reason, although the appveyor platform is specified as x64 it is pulling in an ia32 version of Node. If this could be representative of an actual user installation then I will need to adjust some things to handle cross-compilation, however it just looks a bit off to me.

Here's Appveryor's log:

Using Atom version: 
Atom    : 1.16.0
Electron: 1.3.13
Chrome  : 52.0.2743.82
Node    : 6.5.0
Using APM version: 
apm  1.16.1
npm  3.10.5
node 6.9.5 ia32
python 2.7.13
git 2.12.2.windows.2
visual studio 2015
Downloading package dependencies...
Installing modules done
Using Node.js version:
v4.8.2
Using NPM version:
2.15.11

Versuses Travis:

Using Atom version:
Atom    : 1.25.0
Electron: 1.7.11
Chrome  : 58.0.3029.110
Node    : 7.9.0
Using APM version:
apm  1.19.0
npm  3.10.10
node 6.9.5 x64
atom 1.25.0
python 2.7.11
git 2.14.2

So I guess my question is A) would this be representative of an end user install and B) if not what could I do to assist in ensuring it's pulling in a version that matches the environment?

Dev channel builds failing on Travis CI

Description

When a package's build runs on Travis CI, and the build matrix includes the dev channel, Travis CI fails while installing Atom.

For example, the atom/ci README refers to atom/wrap-guide as an example of how to atom/ci is intended to be used. But when Travis CI attempts to run CI for atom/wrap-guide, it fails while trying to install the Atom dev release:

dpkg-deb: error: archive 'atom-amd64.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up

We first observed this issue in the Teletype nightly build, but it appears to affect any Atom package that attempts to run CI against the Atom dev channel release. For example, we can see the same failure in atom/wrap-guide's build: https://travis-ci.org/atom/wrap-guide/jobs/551945689#L509

Stop using `appveyor` command

The use of the appveyor command in the PowerShell script is currently preventing the CI script from being executed in other environments.

There is no good reason for using that command, so we should replace it.

Move back to bundled Node.js?

Now that Atom v1.10.0 is on stable, should the CI scripts default back to using the bundled Node.js for everything? Keeping the option to override if necessary, of course.

apm and atom not added to the PATH on Travis

Running the script on Travis the apm and atom are available in ~/atom/usr/bin but they are not added to the PATH.

apm can be used within a npm script, as on Travis the home folder is part of the npm bin path.
But it's not possible to execute apm nor atom directly as a script.

.travis.ymlexample:

script:
  - curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh
  - chmod u+x build-package.sh
  - ./build-package.sh
  - atom -v

It fails with the error sh: 1: atom: not found.

This can be solved with export PATH=$PATH:~/atom/usr/bin

ESLint fails to import in build_package.sh

Description

Currently this line in the all-in-one CI script:

https://github.com/atom/ci/blob/master/build-package.sh#L166

throws the following warnings/errors:

(node:4287) Warning: require() of ES modules is not supported.
require() of /home/travis/gopath/src/github.com/org/repo/node_modules/@eslint/eslintrc/universal.js from /home/travis/gopath/src/github.com/org/repo/node_modules/eslint/lib/linter/linter.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename universal.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/travis/gopath/src/github.com/org/repo/node_modules/@eslint/eslintrc/package.json.

/home/travis/gopath/src/github.com/org/repo/lib/main.js
0:0 error Parsing error: Cannot use import statement outside a module

Steps to Reproduce

Execute build-package.sh as part of CI.

Expected behavior:

Successful script execution.

Actual behavior:

ESLint module fails.

Reproduces how often:

100%

Versions

master/HEAD

Additional Information

I have no idea how to modify the eslint module usage to update for this new problem. It just started occurring about a few months ago.

GitHub Actions

Is there an example that uses GitHub Actions to run tests on all the operating systems?

build-package.sh fails to extract deb package with beta channel on Travis CI with Ubuntu Trusty

Description

CI tests with Travis and Ubuntu Trusty fails for atom beta channel.


jobs:
  include:
    - stage: test
      env: ATOM_CHANNEL=beta

Expected behavior:

Test passes.

Actual behavior:

$ curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh
The command "curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh" exited with 0.
0.00s$ chmod u+x build-package.sh
The command "chmod u+x build-package.sh" exited with 0.
0.84s$ ./build-package.sh
Downloading latest Atom release on the beta channel...
dpkg-deb: error: archive 'atom-amd64.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
Using Atom version:
./build-package.sh: 94: ./build-package.sh: /home/travis/atom/usr/bin/atom-beta: not found
Using APM version:
./build-package.sh: 96: ./build-package.sh: /home/travis/atom/usr/bin/apm-beta: not found
Downloading package dependencies...
./build-package.sh: 102: ./build-package.sh: /home/travis/atom/usr/bin/apm-beta: not found
Running specs...
./build-package.sh: 196: ./build-package.sh: /home/travis/atom/usr/bin/atom-beta: not found
The command "./build-package.sh" exited with 127.

Reproduces how often:

Always.

Versions

atom-amd64.deb

dpkg-deb -I atom-amd64.deb 
 paquete Debian nuevo, versión 2.0.
 tamaño 108049684 bytes: archivo de control= 640 bytes.
     654 bytes,    12 líneas     control              
 Package: atom-beta
 Version: 1.39.0-beta3
 Depends: git, libgconf-2-4 (>= 3.2.5) | libgconf2-4, libgtk-3-0 (>= 3.9.10), libgcrypt11 | libgcrypt20, libnotify4, libxtst6, libnss3 (>= 2:3.22), python, gvfs-bin, xdg-utils, libx11-xcb1, libxss1, libasound2 (>= 1.0.16), libxkbfile1, libcurl3 | libcurl4, policykit-1
 Recommends: lsb-release
 Suggests: libsecret-1-0, gir1.2-gnomekeyring-1.0
 Section: devel
 Priority: optional
 Architecture: amd64
 Installed-Size: 631884
 Maintainer: GitHub <[email protected]>
 Description: A hackable text editor for the 21st Century.
  Atom is a free and open source text editor that is modern, approachable, and hackable to the core.

Travis

dist: trusty

Additional Information

I tryed to fix the issue based on the solution provided on travis-ci/travis-ci#9361, upgrade to dpkg >= 1.17.5ubuntu5.8, which fixes https://bugs.launchpad.net/ubuntu/+source/dpkg/+bug/173062

install:
  - sudo apt-get install -qq -y dpkg

with no success

Downloading latest Atom release on the beta channel...

Using Atom version:

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.

Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received

The build has been terminate

I can confirm that changing the distro to dist: xenial (needs libgconf-2-4 to run atom) builds the package and runs the tests without any problem so looks like the problem is not directly related to the build script.

Build script broken with ESLint 3.x?

Hello,

I am using the build-package.sh and it has always worked great for my project, but since I've updated to ESLint 3.x my build is broken.

The problem seems to be that the script uses the APM versions, which is Node 0.10.40, but ESLint 3.x requires Node >=4.

Is there a way to fix or work around this?

appveyor beta error

Description

appveyor error on beta version

https://ci.appveyor.com/project/UziTech/git-menu/build/job/b6dtdqlg1e1tqydr

Using Atom version: & : The term 'C:\projects\git-menu\Atom Beta\atom.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is 
correct and try again.
At line:55 char:18
+     $atomVer = & "$script:ATOM_EXE_PATH" --version | Out-String
+                  ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\projects\git-menu\Atom Beta\atom.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Steps to Reproduce

  1. run build-package.ps1 on appveyor with ATOM_CHANNEL=beta

Expected behavior:

succeeds

Actual behavior:

fails

Reproduces how often:

100%

Versions

v1.40.0-beta0

Travis fails to install libsecret-1-dev

With the latest build configuration for Travis CI from this repository my builds are failing with the following error:

E: Unable to locate package libsecret-1-dev
apt-get install failed
The command "sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install build-essential git libgnome-keyring-dev libsecret-1-dev fakeroot" failed and exited with 100 during .
Your build has been stopped.

https://travis-ci.org/subesokun/atom-tree-view-git-status/jobs/234570128

Some ideas how to solve this issue? Thanks a lot :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.