diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000..516b66d8 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,46 @@ +# See https://www.appveyor.com/docs/getting-started-with-appveyor-for-linux/ +skip_branch_with_pr: true + +# AppVeyor will run on the output branch commits unless the first line of the +# commit message contains '[ci skip]' +# Enable 'Do not build on "Push" events' in the AppVeyor project settings +# to only build commits from pull requests +branches: + only: + - master + +only_commits: + files: + - content/ + +image: ubuntu +services: + - docker + +install: + - source ci/install.sh + +test_script: + - bash build/build.sh + - MANUSCRIPT_FILENAME=manuscript-$APPVEYOR_BUILD_VERSION-${APPVEYOR_REPO_COMMIT:0:7}.pdf + - cp output/manuscript.pdf $MANUSCRIPT_FILENAME + - appveyor PushArtifact $MANUSCRIPT_FILENAME + +build: off + +cache: + - ci/cache + +on_success: + - echo "Artifacts available from https://ci.appveyor.com/project/$APPVEYOR_REPO_NAME/builds/$APPVEYOR_BUILD_ID/artifacts" + - echo "Updated PDF available from https://ci.appveyor.com/api/buildjobs/$APPVEYOR_JOB_ID/artifacts/$MANUSCRIPT_FILENAME" + +# The following lines can be safely deleted, which will disable AppVeyorBot +# notifications in GitHub pull requests +# Notifications use Mustache templates http://mustache.github.io/mustache.5.html +# See https://www.appveyor.com/docs/notifications/#customizing-message-template +# for available variables +notifications: + - provider: GitHubPullRequest + template: "{{#passed}}:white_check_mark:{{/passed}}{{#failed}}:x:{{/failed}} [Build {{&projectName}} {{buildVersion}} {{status}}]({{buildUrl}}) (commit {{commitUrl}} by @{{&commitAuthorUsername}}) + {{#jobs}}{{#artifacts}}
Generated [{{fileName}}]({{permalink}}) for review{{/artifacts}}{{/jobs}}" diff --git a/.travis.yml b/.travis.yml index ab7f1609..8edfab99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,19 +6,8 @@ services: branches: only: - master -before_install: - - wget https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Linux-x86_64.sh - --output-document miniconda.sh - - bash miniconda.sh -b -p $HOME/miniconda - - source $HOME/miniconda/etc/profile.d/conda.sh - - hash -r - - conda config - --set always_yes yes - --set changeps1 no install: - - conda env create --quiet --file build/environment.yml - - conda list --name manubot - - conda activate manubot + - source ci/install.sh script: - bash build/build.sh cache: diff --git a/SETUP.md b/SETUP.md index 70c1c826..14e4c96c 100644 --- a/SETUP.md +++ b/SETUP.md @@ -196,3 +196,14 @@ When there are no longer any unstaged changes, then do `git commit`. If updating `master` via a pull request, proceed to push the commit to GitHub and open a pull request. Once the pull request is ready to merge, use GitHub's "Create a merge commit" option rather than "Squash and merge" or "Rebase and merge" to preserve the rootstock commit hashes. + +# Previewing pull request builds with AppVeyor + +You can optionally enable AppVeyor continuous integration to view pull request builds. +Unlike Travis CI, AppVeyor supports storing manuscripts generated during pull request builds as artifacts. +These can be previewed to facilitate pull request review and ensure formatting and reference changes render as expected. +When a pull request build runs successfully, the AppVeyorBot will post a notification in the pull request linking to the versioned manuscript PDF. + +To enable AppVeyor, follow steps 1 and 2 of the [AppVeyor welcome](https://www.appveyor.com/docs/) to sign in to AppVeyor and add your manuscript repository as an AppVeyor project. +The repository already contains an `.appveyor.yml` build configuration file, so no other setup is required. +AppVeyor is configured to only run when the files in the `content` directory are modified. diff --git a/ci/deploy.sh b/ci/deploy.sh index b6c0514f..4f9127ad 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -59,7 +59,7 @@ fi # Commit message MESSAGE="\ -$(git log --max-count=1 --format='%s') +$(git log --max-count=1 --format='%s') [ci skip] This build is based on https://github.com/$TRAVIS_REPO_SLUG/commit/$TRAVIS_COMMIT. @@ -68,8 +68,6 @@ This commit was created by the following Travis CI build and job: $TRAVIS_BUILD_WEB_URL $TRAVIS_JOB_WEB_URL -[ci skip] - The full commit message that triggered this build is copied below: $TRAVIS_COMMIT_MESSAGE diff --git a/ci/install.sh b/ci/install.sh new file mode 100644 index 00000000..252d8892 --- /dev/null +++ b/ci/install.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +## install.sh: run during a Travis CI or AppVeyor build to install the conda environment. + +# Set options for extra caution & debugging +set -o errexit \ + -o pipefail + +wget https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Linux-x86_64.sh \ + --output-document miniconda.sh +bash miniconda.sh -b -p $HOME/miniconda +source $HOME/miniconda/etc/profile.d/conda.sh +hash -r +conda config \ + --set always_yes yes \ + --set changeps1 no +conda env create --quiet --file build/environment.yml +conda list --name manubot +conda activate manubot diff --git a/content/metadata.yaml b/content/metadata.yaml index 553de29c..7593a5cc 100644 --- a/content/metadata.yaml +++ b/content/metadata.yaml @@ -15,7 +15,7 @@ author_info: email: john.doe@something.com affiliations: - Department of Something, University of Whatever - funders: Grant XXXXXXXX + funders: Grant XXXXXXXXX - github: janeroe name: Jane Roe