Compare commits
No commits in common. "master" and "v0.6" have entirely different histories.
49
.travis.yml
49
.travis.yml
|
@ -1,13 +1,42 @@
|
||||||
# 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
|
language: c
|
||||||
|
|
||||||
|
# Supply at least one RACKET_VERSION environment variable definition
|
||||||
|
# here. RACKET_VERSION is used by the install-racket.sh script
|
||||||
|
# (specifed below under before_install) to select the version of
|
||||||
|
# Racket to download and install.
|
||||||
|
#
|
||||||
|
# If you supply more than one, you can create multiple builds (a
|
||||||
|
# Travis-CI build matrix resulting in multiple builds). You can use
|
||||||
|
# this to test against multiple Racket versions.
|
||||||
|
env:
|
||||||
|
- RACKET_VERSION=5.3.4
|
||||||
|
- RACKET_VERSION=5.3.5
|
||||||
|
- RACKET_VERSION=5.92
|
||||||
|
- RACKET_VERSION=6.0
|
||||||
|
- RACKET_VERSION=HEAD
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
# Note: Important to pipe this to `bash` not to `sh`.
|
||||||
|
- curl https://raw.github.com/greghendershott/travis-racket/master/install-racket.sh | bash
|
||||||
|
|
||||||
|
install:
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
|
||||||
|
# Here supply steps such as raco make, raco test, etc. Note that you
|
||||||
|
# need to supply /usr/racket/bin/ -- it's not in PATH. You can run
|
||||||
|
# `raco pkg install --deps search-auto <pkg>` to install any required
|
||||||
|
# packages without it getting stuck on a confirmation prompt.
|
||||||
script:
|
script:
|
||||||
- shellcheck install-racket.sh
|
- /usr/racket/bin/raco make main.rkt
|
||||||
- shellcheck test.sh
|
- /usr/racket/bin/raco test -x .
|
||||||
- ./test.sh
|
|
||||||
|
# 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:
|
||||||
|
# - /usr/racket/bin/raco pkg install --deps search-auto --link <pkg>
|
||||||
|
# - /usr/racket/bin/raco test -x -p <pkg>
|
||||||
|
|
||||||
|
after_script:
|
||||||
|
|
47
README.md
47
README.md
|
@ -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
|
To add this capability to your project, simply add the
|
||||||
[`setup-racket`](https://github.com/Bogdanp/setup-racket) with GitHub
|
[example `.travis.yml`](https://github.com/greghendershott/travis-racket/blob/master/.travis.yml)
|
||||||
Actions.
|
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
|
> **NOTE:** In the `before_install:` step, be sure to pipe the `install-racket.sh` script to `bash` (_not_ to `sh`).
|
||||||
baton.
|
|
||||||
|
|
||||||
If you're willing and able to pay Travis CI, you might still find this
|
Here's a "badge" showing the status for the `master` branch of this
|
||||||
repo useful. You can fork it. Someday, when there is a new version of
|
repo:
|
||||||
Racket, you might need to update the `install-racket.sh` script (as I
|
|
||||||
would have done, but won't be doing anymore).
|
|
||||||
|
|
||||||
I'm not going to "Archive" this repo -- which would make it read-only
|
[](https://travis-ci.org/greghendershott/travis-racket)
|
||||||
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.
|
|
||||||
|
|
|
@ -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>
|
|
|
@ -1,137 +1,29 @@
|
||||||
#!/bin/bash
|
# 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.
|
||||||
# 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).
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [[ "$RACKET_MINIMAL" = "1" ]]; then
|
if [[ "$RACKET_VERSION" = "HEAD" ]]; then
|
||||||
MIN="minimal-"
|
URL="http://www.cs.utah.edu/plt/snapshots/current/installers/racket-current-x86_64-linux-precise.sh"
|
||||||
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_MINIMAL" = "1" ]]; then
|
|
||||||
URL="${HEAD_BASE}/installers/racket-minimal-current-x86_64-linux-precise-bc.sh"
|
|
||||||
else
|
|
||||||
URL="${HEAD_BASE}/installers/racket-current-x86_64-linux-precise-bc.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" = 5.9* ]]; then
|
elif [[ "$RACKET_VERSION" = 5.9* ]]; then
|
||||||
URL="${DL_BASE}/${RACKET_VERSION}/racket-${MIN}${RACKET_VERSION}-x86_64-linux-ubuntu-quantal.sh"
|
URL="http://download.racket-lang.org/installers/${RACKET_VERSION}/racket-${RACKET_VERSION}-x86_64-linux-ubuntu-quantal.sh"
|
||||||
elif [[ "$RACKET_VERSION" = 6.[0-4] ]] || [[ "$RACKET_VERSION" = 6.[0-4].[0-9] ]]; then
|
elif [[ "$RACKET_VERSION" = 6.0* ]]; 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-precise.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
|
else
|
||||||
echo "ERROR: Unsupported version ${RACKET_VERSION}"
|
URL="http://download.racket-lang.org/installers/${RACKET_VERSION}/racket/racket-${RACKET_VERSION}-bin-x86_64-linux-debian-squeeze.sh"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%-25s" "${MIN}${RACKET_VERSION}${RACKET_NATIPKG}${RACKET_CS}"
|
INSTALL="./racket-${RACKET_VERSION}.sh"
|
||||||
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/"
|
|
||||||
fi
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$TEST" ]; then
|
echo "Downloading $URL to $INSTALL:"
|
||||||
exit 0
|
curl -L -o $INSTALL $URL
|
||||||
fi
|
|
||||||
|
|
||||||
# Older .travis.yml files don't set $RACKET_DIR (the Racket install
|
echo "Running $INSTALL to install Racket:"
|
||||||
# directory) explicitly and expect it to be /usr/racket.
|
chmod u+rx "$INSTALL"
|
||||||
if [[ "$RACKET_DIR" = "" ]]; then
|
sudo "$INSTALL" <<EOF
|
||||||
RACKET_DIR=/usr/racket
|
|
||||||
fi
|
|
||||||
|
|
||||||
INSTALLER="./racket-${MIN}${RACKET_VERSION}.sh"
|
|
||||||
|
|
||||||
echo "Downloading $URL to $INSTALLER:"
|
|
||||||
curl -L -o "$INSTALLER" "$URL"
|
|
||||||
|
|
||||||
echo "Making $INSTALLER executable:"
|
|
||||||
chmod u+rx "$INSTALLER"
|
|
||||||
|
|
||||||
# Only use sudo if installing to /usr
|
|
||||||
if [[ "$RACKET_DIR" = /usr* ]]; then
|
|
||||||
RUN_INSTALLER="sudo ${INSTALLER}"
|
|
||||||
else
|
|
||||||
RUN_INSTALLER="${INSTALLER}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Running $RUN_INSTALLER to install Racket:"
|
|
||||||
|
|
||||||
$RUN_INSTALLER <<EOF
|
|
||||||
no
|
no
|
||||||
"$RACKET_DIR"
|
/usr/racket
|
||||||
|
|
||||||
EOF
|
# EOF
|
||||||
|
|
||||||
if [[ "$RACKET_MINIMAL" = "1" ]]; then
|
|
||||||
echo "Minimal Racket: Installing packages for raco test..."
|
|
||||||
${RACKET_DIR}/bin/raco pkg install --auto --scope installation rackunit-lib compiler-lib
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
14
main.rkt
Normal file
14
main.rkt
Normal 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
28
test.sh
|
@ -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
|
|
Loading…
Reference in New Issue
Block a user