Skip to content

Commit

Permalink
[se-edu#192] Set Up AppVeyor CI (se-edu#218)
Browse files Browse the repository at this point in the history
AppVeyor[1] is a continuous integration service used to build and test
projects on a Windows VM. Adding AppVeyor support to this project will
allow us to easily ensure that our tests do not break on Windows.

Add an appveyor.yml file that will teach AppVeyor how to build this
project and run its tests.

Update our documentation to explain to developers how to set up AppVeyor
on their own repositories.

For now, we will run our tests with 64-bit Java only, since the project
does not use any native libraries and thus is unlikely to have any
architecture-specific bugs. In the future, should we use any native
libraries, the appveyor.yml file should be updated to run our tests on
both 32-bit and 64-bit Java.

[1] https://www.appveyor.com/
  • Loading branch information
pyokagan authored Dec 20, 2016
1 parent 311ab3c commit 04f0810
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 2 deletions.
18 changes: 18 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# AppVeyor configuration file
# For more details see https://www.appveyor.com/docs/build-configuration/

# Call on gradle to build and run tests
# --no-daemon: Prevent the daemon from launching to prevent file-in-use errors
# when we cache the ~/.gradle directory
build_script:
- gradlew.bat --no-daemon assemble checkstyleMain checkstyleTest

test_script:
- appveyor-retry gradlew.bat --no-daemon headless allTests

environment:
JAVA_HOME: C:\Program Files\Java\jdk1.8.0 # Use 64-bit Java

# Files/folders to preserve between builds to speed them up
cache:
- C:\Users\appveyor\.gradle
4 changes: 2 additions & 2 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ See [UsingGradle.md](UsingGradle.md) to learn how to use Gradle for build automa

### Continuous Integration

We use [Travis CI](https://travis-ci.org/) to perform _Continuous Integration_ on our projects.
See [UsingTravis.md](UsingTravis.md) for more details.
We use [Travis CI](https://travis-ci.org/) and [AppVeyor](https://www.appveyor.com/) to perform _Continuous Integration_ on our projects.
See [UsingTravis.md](UsingTravis.md) and [UsingAppVeyor.md](UsingAppVeyor.md) for more details.

### Making a Release

Expand Down
77 changes: 77 additions & 0 deletions docs/UsingAppVeyor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# AppVeyor

[AppVeyor](https://www.appveyor.com/) is a _Continuous Integration_ platform for GitHub projects.
It runs its builds on Windows virtual machines.

AppVeyor can run the project's tests automatically whenever new code is pushed to the repo.
This ensures that existing functionality and features have not been broken on Windows by the changes.

The current AppVeyor setup performs the following things whenever someone pushes code to the repo:

* Runs the `gradlew.bat headless allTests` command.

* Automatically retries the build up to 3 times if a task fails.

If you would like to customize your AppVeyor build further, you can learn more about AppVeyor from the
[AppVeyor Documentation](https://www.appveyor.com/docs/).

## Setting up AppVeyor

1. Fork the repo to your own organization.

2. Go to https://ci.appveyor.com/, and under `Login`, click on `GitHub` to login with your GitHub account.
Enter your GitHub account details if needed.

![Click on GitHub in the login page](images/appveyor/login.png)

3. After logging in, you will be brought to your projects dashboard. Click on `NEW PROJECT`.

![Click on "NEW PROJECT" in the projects dashboard](images/appveyor/add-project-1.png)

4. You will be brought to the `Select repository` page. Select `GitHub`.

* On your first usage of AppVeyor, you will need to give AppVeyor authorization to your GitHub account.
Click on `Authorize GitHub`.

![Click on Authorize GitHub](images/appveyor/add-project-2.png)

* This will bring you to a GitHub page that manages the access of third-party applications to your repositories.

Depending on whether you are the owner of the repository, you can either grant access:

![Grant Access](images/grant_access.png)

Or request access:

![Request Access](images/request_access.png)

5. AppVeyor will then list the repositories you have access to in your GitHub account.
Find the repository you want to set AppVeyor up on, and then click `ADD`.

![Click "Add" on the repository you want to set AppVeyor up on](images/appveyor/add-project-3.png)

6. AppVeyor will then be activated on that repository.
To see the CI in action, push a commit to any branch!

* Go to the repository and see the pushed commit. There should be an icon which will link you to the AppVeyor build:

![Commit build](images/appveyor/ci-pending.png)

* As the build is run on a remote machine, we can only examine the logs it produces:

![AppVeyor build](images/appveyor/ci-log.png)

7. Update the link to the "build status" badge at the top of `README.md` to point to the AppVeyor build status of your own repo.

* To find your build status badge URL,
first go to your project settings by clicking on the "Settings" icon:

![Click on project settings](images/appveyor/project-settings-1.png)

* Then go to the `Badges` section of your project settings by clicking on it:

![Click on "Badges"](images/appveyor/project-settings-2.png)

* Then copy and paste the markdown code for your `master` branch to your `README.md` file:

![Copy and paste the markdown code for your `master` branch to your `README.md` file](images/appveyor/project-settings-3.png)
Binary file added docs/images/appveyor/add-project-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/appveyor/add-project-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/appveyor/add-project-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/appveyor/ci-log.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/appveyor/ci-pending.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/appveyor/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/appveyor/project-settings-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/appveyor/project-settings-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/appveyor/project-settings-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 04f0810

Please sign in to comment.