Skip to content

Commit

Permalink
fix CI build to use packages from the repository (#87)
Browse files Browse the repository at this point in the history
The build workflow would setup the package catalog as current user, but
run the build as root using sudo.  This meant that the build used a
different package catalog and plot packages were retrieved from the
package catalog, instead of being locally build, effectively defeating
the CI process.  This probably worked in the original setup because all
commands were run as "root", but broke when updating to setup-racket
0.10.

Updated the CI workflow to run all racket commands as the current user
and also updated setup-racket to 1.1 and Racket fto 8.0
  • Loading branch information
ralsei committed Mar 4, 2021
1 parent e61eff8 commit a237ef7
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,46 @@ jobs:
# the failure is specific to a Racket version.
fail-fast: false
matrix:
racket-version: ["7.9", "current"]
racket-variant: ["regular", "CS"]
racket-version: ["8.0", "current"]
racket-variant: ["BC", "CS"]
steps:
- uses: actions/checkout@v2
- uses: Bogdanp/setup-racket@v0.10
- uses: Bogdanp/setup-racket@v1.1
with:
architecture: x64
distribution: minimal
variant: ${{ matrix.racket-variant }}
version: ${{ matrix.racket-version }}
dest: '${HOME}/racket'
sudo: never

# Setup this source repository as a package catalog which has higher
# priority than the main catalog

- run: racket -l- pkg/dirs-catalog --link catalog .
- run: ${HOME}/racket/bin/racket -l- pkg/dirs-catalog --link catalog .
- run: echo "file://`pwd`/catalog" > catalogs.txt
- run: raco pkg config catalogs >> catalogs.txt
- run: raco pkg config --set catalogs `cat catalogs.txt`
- run: raco pkg config catalogs
- run: ${HOME}/racket/bin/raco pkg config catalogs >> catalogs.txt
- run: ${HOME}/racket/bin/raco pkg config --set catalogs `cat catalogs.txt`
- run: ${HOME}/racket/bin/raco pkg config catalogs

# Install plot and its dependencies. Since we installed minimal racket,
# this will fetch most of the packages from the main package catalog,
# except for the packages inside this directory, which have higher
# priority.

- run: sudo raco pkg install --batch --auto plot
- run: ${HOME}/racket/bin/raco pkg install --batch --auto plot

# This runs any tests inside the plot, plot-lib, plot-gui-lib and
# plot-doc packages, but NOT the plot-test package. The actual tests
# are in the `plot-test` package, so we don't expect any tests here, but
# just in case someone wrote a test module...

- run: sudo xvfb-run raco test --deps --package plot
- run: xvfb-run ${HOME}/racket/bin/raco test --deps --package plot

# Install the plot-test package and run the tests

- run: sudo raco pkg install --batch --auto plot-test
- run: sudo xvfb-run raco test --package plot-test
- run: ${HOME}/racket/bin/raco pkg install --batch --auto plot-test
- run: xvfb-run ${HOME}/racket/bin/raco test --package plot-test

# If any of the plot-test tests failed, they will generate new draw step
# files and sample images. Upload these as an Github Actions Artifact,
Expand Down

0 comments on commit a237ef7

Please sign in to comment.