Compare commits

..

10 Commits

Author SHA1 Message Date
Greg Hendershott
3e8ce134a2 Install rackunit-lib and compiler-lib
Latter provides the `raco test` command.
2015-05-18 21:35:18 -04:00
Greg Hendershott
96953efd06 Install rackunit (revert previous commit) 2015-05-18 21:32:22 -04:00
Greg Hendershott
d7fafefbcc Install rackunit-lib instead of rackunit 2015-05-18 21:20:33 -04:00
Greg Hendershott
c6f15f1888 Fix raco command 2015-05-18 20:54:01 -04:00
Greg Hendershott
ebbdab3de8 Switch from RACKET_EDITION=MINIMAL to RACKET_MINIMAL=1
Also:

- Only support it for 6.x and HEAD. Don't bother with 5.9x, and don't
  try to support textual (it's too different).

- For the minimal case, do the raco pkg install of rackunit in
  install-racket.sh. Can conditionally test, there. Also, easier for
  users than them having to do it in .travis.yml.
2015-05-18 20:34:57 -04:00
Greg Hendershott
ce1dbbf583 Adjust script section.
Minimal Racket in 6.0+ is very minimal -- raco make and raco test
commands don't exist. Install rackunit.
2015-05-18 20:12:56 -04:00
Greg Hendershott
3cfe5074a8 Temporary hack to .travis.yml to test 2015-05-18 18:32:55 -04:00
Greg Hendershott
ae7f90507a Fix env var set 2015-05-18 18:05:47 -04:00
Greg Hendershott
31a1e466fb Excercise RACKET_EDITION in example .travis.yml 2015-05-18 17:37:31 -04:00
Greg Hendershott
c3a5f7e085 Add RACKET_EDITION to install-racket.sh
Note: I'm committing this without also updating the example .travis.yml,
in order to test the case where RACKET_EDITION is not specified at
all (e.g. for backward compatability with existing .travis.yml files).
In that case it should act like RACKET_EDITION=FULL.
2015-05-18 14:23:33 -04:00
6 changed files with 115 additions and 245 deletions

View File

@ -1,13 +1,76 @@
# IMPORTANT:
#
# This is NOT an example of a .travis.yml you would use in your own
# Racket project -- for that, see example/.travis.yml.
#
# Instead, this is used by this repo to test install-racket.sh.
language: c
# Optional: To use Travis CI's newer container infrastucture,
# un-comment the following line. (Also be sure RACKET_DIR is set to
# somewhere like ~/racket that doesn't require sudo.)
#
# sudo: false
env:
global:
# Supply a global RACKET_DIR environment variable. This is where
# Racket will be installed. A good idea is to use ~/racket because
# that doesn't require sudo to install and is therefore compatible
# with Travis CI's newer container infrastructure.
- RACKET_DIR=~/racket
matrix:
# Supply at least one RACKET_VERSION environment variable. This is
# used by the install-racket.sh script (run at before_install,
# below) to select the version of Racket to download and install.
#
# Supply more than one RACKET_VERSION (as in the example below) to
# create a Travis-CI build matrix to test against multiple Racket
# versions.
- RACKET_VERSION=5.3.4
- RACKET_VERSION=5.3.5
- RACKET_VERSION=5.92
- RACKET_VERSION=6.0
- RACKET_VERSION=6.1
- RACKET_VERSION=6.1.1
- RACKET_VERSION=HEAD
- RACKET_VERSION=SCOPE_SNAPSHOT
# Optionally, can also supply RACKET_MINIMAL=1. Only works for
# Racket 6.0+ or HEAD.
- RACKET_VERSION=6.0 RACKET_MINIMAL=1
- RACKET_VERSION=6.1 RACKET_MINIMAL=1
- RACKET_VERSION=6.1.1 RACKET_MINIMAL=1
- RACKET_VERSION=HEAD RACKET_MINIMAL=1
# You may want to test against certain versions of Racket, without
# having them count against the overall success/failure.
matrix:
allow_failures:
- env: RACKET_VERSION=HEAD
- env: RACKET_VERSION=HEAD RACKET_MINIMAL=1
- env: RACKET_VERSION=SCOPE_SNAPSHOT
# Fast finish: Overall build result is determined as soon as any of
# its rows have failed, or, all of its rows that aren't allowed to
# fail have succeeded.
fast_finish: true
before_install:
- git clone https://github.com/greghendershott/travis-racket.git
- cd travis-racket # REMOVE BEFORE MERGING TO MASTER
- git checkout minimal # REMOVE BEFORE MERGING TO MASTER
- cd .. # REMOVE BEFORE MERGING TO MASTER
- cat travis-racket/install-racket.sh | bash # pipe to bash not sh!
- export PATH="${RACKET_DIR}/bin:${PATH}" #install-racket.sh can't set for us
install:
before_script:
# Here supply steps such as raco make, raco test, etc.
script:
- shellcheck install-racket.sh
- shellcheck test.sh
- ./test.sh
- raco test -x .
# NOTE: If your repo is a Racket package with an info.rkt that
# includes some `deps`, the following is more elegant:
#
# script:
# - cd .. # Travis did a cd into the dir. Back up, for the next:
# - raco pkg install --deps search-auto --link <pkg>
# - raco test -x -p <pkg>
after_script:

View File

@ -1,40 +1,17 @@
# Deprecated
Experimenting with using Travis CI for a Racket project.
As of 2020-11-25 I no longer use Travis CI for my projects.
Until Travis CI gets built-in support for Racket, we can use the
`before_install` clause of `.travis.yml` to download and run the
Racket installer.
Instead I am using
[`setup-racket`](https://github.com/Bogdanp/setup-racket) with GitHub
Actions.
To add this capability to your project, simply add the
[example `.travis.yml`](https://github.com/greghendershott/travis-racket/blob/master/.travis.yml)
to your repo. You may need to change its `script` section's `raco
make` and `raco test` parts.
After maintaining this repo for eight years, I'm glad to pass the
baton.
> **NOTE:** In the `before_install:` step, be sure to pipe the `install-racket.sh` script to `bash` (_not_ to `sh`).
If you're willing and able to pay Travis CI, you might still find this
repo useful. You can fork it. Someday, when there is a new version of
Racket, you might need to update the `install-racket.sh` script (as I
would have done, but won't be doing anymore).
Here's a "badge" showing the status for the `master` branch of this
repo:
I'm not going to "Archive" this repo -- which would make it read-only
for issues and pull-requests -- right away. So if you have any
questions, feel feee to open an issue. But eventually I probably
will archive it.
# Still want to use this? Here's the old README
Until/unless Travis CI gets built-in support for Racket, we can use
the `install:` section of `.travis.yml` to download and run the
installer for various versions and variants of Racket.
To use in your project, simply add the [example
`.travis.yml`](example/.travis.yml) to the root of your repo.
> **NOTE:** Use `example/.travis.yml` --- *not* the one in the root of
> this repo, which is intended to test this repo not your project.
You may need to make some small edits to the file, as explained in its
comments. Specifically:
- You may want to change the `RACKET_VERSION` values, depending on
which versions of Racket you intend to support.
- You may need to change its `script:` section to suit your project.
[![Build Status](https://travis-ci.org/greghendershott/travis-racket.png?branch=master)](https://travis-ci.org/greghendershott/travis-racket)

View File

@ -1,79 +0,0 @@
language: c
env:
global:
# Supply a global RACKET_DIR environment variable. This is where
# Racket will be installed. A good idea is to use ~/racket because
# that doesn't require sudo to install.
- RACKET_DIR=~/racket
matrix:
# Supply at least one RACKET_VERSION environment variable. This is
# used by the install-racket.sh script to select the version of
# Racket to download and install.
#
# Supply more than one RACKET_VERSION (as in the example below) to
# create a Travis-CI build matrix to test against multiple Racket
# versions.
- RACKET_VERSION=6.3
- RACKET_VERSION=6.4
- RACKET_VERSION=6.5
- RACKET_VERSION=6.6
- RACKET_VERSION=6.7
- RACKET_VERSION=6.8
- RACKET_VERSION=6.9
- RACKET_VERSION=6.10
- RACKET_VERSION=6.11
- RACKET_VERSION=6.12
- RACKET_VERSION=7.0
- RACKET_VERSION=7.1
- RACKET_VERSION=7.2
- RACKET_VERSION=7.3
- RACKET_VERSION=7.4
- RACKET_VERSION=7.5
- RACKET_VERSION=7.6
- RACKET_VERSION=7.7
- RACKET_VERSION=7.8
- RACKET_VERSION=7.9
- RACKET_VERSION=7.9 RACKET_CS=1
# "HEAD" is a daily snapshot built from the `master` branch.
# This is the main variant of Racket that uses its own runtime.
- RACKET_VERSION=HEAD
# "HEADCS" is a daily snapshot built from the `master` branch.
# This is an experimental variant of Racket that uses Chez Scheme.
- RACKET_VERSION=HEADCS
# "RELEASE" is a release candidate that updates only during the
# weeks before a new release. The final release candidate should
# remain available until the next release cycle. As a result, you
# may leave this in your .travis.yml all the time. See:
# <https://pre-release.racket-lang.org/>.
- RACKET_VERSION=RELEASE
matrix:
# You may want to test against certain versions of Racket, without
# having them count against the overall success/failure. For example
# here we include the development versions:
allow_failures:
- env: RACKET_VERSION=HEAD
- env: RACKET_VERSION=HEADCS
- env: RACKET_VERSION=RELEASE
# Fast finish: Overall build result is determined as soon as any of
# its rows have failed, or, all of its rows that aren't allowed to
# fail have succeeded.
fast_finish: true
install:
- bash <(curl https://raw.githubusercontent.com/greghendershott/travis-racket/master/install-racket.sh)
- export PATH="${RACKET_DIR}/bin:${PATH}" #install-racket.sh can't set for us
# Here supply steps such as raco make, raco test, etc.
script:
- raco make main.rkt
- raco test -x .
# OR: If your repo is a Racket package with an info.rkt that has any
# `deps`:
#
# script:
# - raco pkg install --deps search-auto
# - raco setup -D --check-pkg-deps <your-package-name>
# - raco test -x -p <your-package-name>

View File

@ -1,103 +1,26 @@
#!/bin/bash
#
# In the Travis CI environment `#!/bin/bash` won't suffice (it's here
# to make shellcheck happy and for convenience when using this script
# locally).
#
# Instead .travis.yml should pipe this script to bash (not to sh).
# IMPORTANT: Your .travis.yml must pipe this to bash (not to sh)!
# In the Travis CI environment a #!/bin/bash shebang here won't help.
set -e
if [[ "$RACKET_MINIMAL" = "1" ]]; then
MIN="minimal-"
else
MIN=""
fi
if [[ "$RACKET_NATIPKG" = "1" ]]; then
RACKET_NATIPKG="-natipkg"
else
RACKET_NATIPKG=""
fi
if [[ "$RACKET_CS" = "1" ]]; then
RACKET_CS="-cs"
else
RACKET_CS=""
fi
# If this section seems like a mess, it is, because reasons:
#
# - The download URL naming conventions have changed over the years.
#
# - The Linux version name has changed over the years.
#
# - From time to time a Racket download server has gone offline, in
# which case this file has been "hot fixed". In the absence of any
# clear resolution signal ("you can resume using the original
# server"), the hot fix remains in place (until maybe someday it
# needs to be hot fixed).
#
# On the one hand, it sucks. On the other hand, a large part of the
# "added value" of this repo that it deals with the suckage so that
# ordinary users need not. They can supply names for Racket versions
# and variants using a consistent naming scheme, and we'll try to make
# it work.
DL_BASE="https://www.cs.utah.edu/plt/installers"
# In theory either NWU or Utah should work for downloading snapshot
# a.k.a. HEAD builds. In practice, it varies from time to time.
## HEAD_BASE="https://plt.eecs.northwestern.edu/snapshots/current"
HEAD_BASE="https://www.cs.utah.edu/plt/snapshots/current"
if [[ "$RACKET_VERSION" = "HEADBC" ]]; then
if [[ "$RACKET_VERSION" = "HEAD" ]]; then
if [[ "$RACKET_MINIMAL" = "1" ]]; then
URL="${HEAD_BASE}/installers/racket-minimal-current-x86_64-linux-precise-bc.sh"
URL="http://plt.eecs.northwestern.edu/snapshots/current/installers/min-racket-current-x86_64-linux-precise.sh"
else
URL="${HEAD_BASE}/installers/racket-current-x86_64-linux-precise-bc.sh"
URL="http://plt.eecs.northwestern.edu/snapshots/current/installers/racket-test-current-x86_64-linux-precise.sh"
fi
elif [[ "$RACKET_VERSION" = "HEADCS" || "$RACKET_VERSION" = "HEAD" ]]; then
if [[ "$RACKET_MINIMAL" = "1" ]]; then
URL="${HEAD_BASE}/installers/racket-minimal-current-x86_64-linux-xenial.sh"
else
URL="${HEAD_BASE}/installers/racket-current-x86_64-linux-xenial.sh"
fi
elif [[ "$RACKET_VERSION" = 5.3* ]]; then
if [[ "$RACKET_MINIMAL" = "1" ]]; then
URL="${DL_BASE}/${RACKET_VERSION}/racket-textual/racket-textual-${RACKET_VERSION}-bin-x86_64-linux-debian-squeeze.sh"
else
URL="${DL_BASE}/${RACKET_VERSION}/racket/racket-${MIN}${RACKET_VERSION}-bin-x86_64-linux-debian-squeeze.sh"
fi
elif [[ "$RACKET_VERSION" = "RELEASE" ]]; then
URL="https://pre-release.racket-lang.org/installers/racket-${MIN}current-x86_64-linux${RACKET_NATIPKG}.sh"
elif [[ "$RACKET_VERSION" = "RELEASECS" ]]; then
URL="https://pre-release.racket-lang.org/installers/racket-${MIN}current-x86_64-linux${RACKET_NATIPKG}-cs.sh"
elif [[ "$RACKET_VERSION" = "SCOPE_SNAPSHOT" ]]; then
URL="http://www.cs.utah.edu/~mflatt/tmp/scope-snapshot/installers/racket-6.2.900.3-x86_64-linux.sh"
elif [[ "$RACKET_VERSION" = 5.9* ]]; then
URL="${DL_BASE}/${RACKET_VERSION}/racket-${MIN}${RACKET_VERSION}-x86_64-linux-ubuntu-quantal.sh"
elif [[ "$RACKET_VERSION" = 6.[0-4] ]] || [[ "$RACKET_VERSION" = 6.[0-4].[0-9] ]]; then
URL="${DL_BASE}/${RACKET_VERSION}/racket-${MIN}${RACKET_VERSION}-x86_64-linux-ubuntu-precise.sh"
URL="http://download.racket-lang.org/installers/${RACKET_VERSION}/racket-${RACKET_VERSION}-x86_64-linux-ubuntu-quantal.sh"
elif [[ "$RACKET_VERSION" = 6.* ]]; then
URL="${DL_BASE}/${RACKET_VERSION}/racket-${MIN}${RACKET_VERSION}-x86_64-linux${RACKET_NATIPKG}.sh"
elif [[ "$RACKET_VERSION" = 7.* ]]; then
URL="${DL_BASE}/${RACKET_VERSION}/racket-${MIN}${RACKET_VERSION}-x86_64-linux${RACKET_NATIPKG}${RACKET_CS}.sh"
else
echo "ERROR: Unsupported version ${RACKET_VERSION}"
exit 1
fi
printf "%-25s" "${MIN}${RACKET_VERSION}${RACKET_NATIPKG}${RACKET_CS}"
echo "@ ${URL}"
if curl -I -L "$URL" 2>&1 | grep 404.Not.Found ; then
echo "Installer not available"
if [[ "$RACKET_VERSION" = "HEAD" ]]; then
echo "Did the build fail? Check the logs at ${HEAD_BASE}/log/"
if [[ "$RACKET_MINIMAL" = "1" ]]; then
URL="http://mirror.racket-lang.org/installers/${RACKET_VERSION}/racket-minimal-${RACKET_VERSION}-x86_64-linux-ubuntu-precise.sh"
else
URL="http://download.racket-lang.org/installers/${RACKET_VERSION}/racket-${RACKET_VERSION}-x86_64-linux-ubuntu-precise.sh"
fi
exit 1
fi
if [ -n "$TEST" ]; then
exit 0
else # 5.3.x
URL="http://download.racket-lang.org/installers/${RACKET_VERSION}/racket/racket-${RACKET_VERSION}-bin-x86_64-linux-debian-squeeze.sh"
fi
# Older .travis.yml files don't set $RACKET_DIR (the Racket install
@ -106,10 +29,10 @@ if [[ "$RACKET_DIR" = "" ]]; then
RACKET_DIR=/usr/racket
fi
INSTALLER="./racket-${MIN}${RACKET_VERSION}.sh"
INSTALLER="./racket-${RACKET_VERSION}.sh"
echo "Downloading $URL to $INSTALLER:"
curl -L -o "$INSTALLER" "$URL"
curl -L -o $INSTALLER $URL
echo "Making $INSTALLER executable:"
chmod u+rx "$INSTALLER"

14
main.rkt Normal file
View File

@ -0,0 +1,14 @@
#lang racket
;; A comment.
(define (plus1 x)
(add1 x))
(define (minus1 x)
(sub1 x))
(module+ test
(require rackunit)
(check-equal? (plus1 1) 2)
(check-equal? (minus1 1) 0))

28
test.sh
View File

@ -1,28 +0,0 @@
#!/bin/bash
# In older Racket versions, there is a "MINIMAL" "flavor".
for VER in 6.4 6.3 6.2 6.2.1 6.1 6.1.1 6.0 6.0.1 5.93 5.92 5.3 5.3.6 5.3.5 5.3.4 5.3.3 5.3.2 5.3.1 ; do
for MIN in 0 1; do
TEST=1 RACKET_MINIMAL=$MIN RACKET_VERSION=$VER ./install-racket.sh || exit 1
done
done
# Starting with Racket 6.5, there is also a "NATIPKG" flavor.
for VER in 7.3 7.2 7.1 7.0 6.12 6.11 6.10 6.9 6.8 6.7 6.6 6.5 ; do
for MIN in 0 1; do
for NAT in 0 1; do
TEST=1 RACKET_MINIMAL=$MIN RACKET_NATIPKG=$NAT RACKET_VERSION=$VER ./install-racket.sh || exit 1
done
done
done
# Starting with Racket 7.4, there is also a "CS" flavor.
for VER in HEAD HEADBC HEADCS 7.9 7.8 7.7 7.6 7.5 7.4 ; do
for MIN in 0 1; do
for NAT in 0 1; do
for CS in 0 1; do
TEST=1 RACKET_MINIMAL=$MIN RACKET_NATIPKG=$NAT RACKET_CS=$CS RACKET_VERSION=$VER ./install-racket.sh || exit 1
done
done
done
done