-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Project Testbot | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
test-bot: | ||
name: Testing ${{ github.head_ref || github.ref_name }} | ||
runs-on: ubuntu-latest | ||
container: | ||
image: 'ghcr.io/macaulay2/testbot:latest' | ||
volumes: | ||
- '${{ github.workspace }}:/home/macaulay' | ||
|
||
steps: | ||
- name: Checkout the project repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run testbot on project branch | ||
run: | | ||
M2 --script tests/testbot.m2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Note: to load the necessary packages from the repository, either: | ||
-- first call installPackage in testbot.m2: | ||
-- installPackage("Elimination", FileName => "/home/macaulay/Elimination.m2") | ||
-- or specify the path to needsPackage: | ||
-- needsPackage("Elimination", FileName => "/home/macaulay/Elimination.m2") | ||
needsPackage "Elimination" | ||
|
||
-- test code and assertions | ||
R = ZZ/101[a..d] | ||
I = monomialCurveIdeal(R, {1, 3, 4}) | ||
assert(eliminate(I, {b}) == ideal(c^4-a*d^3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
-- This is the default testbot.m2 provided for this workshop. | ||
|
||
-- It contains Macaulay2 code and is automatically run every time you open | ||
-- a pull request or push a new commit to a project branch on the GitHub | ||
-- respository, unless you add the string "[skip ci]" to the commit message. | ||
|
||
-- If you have the software Docker installed and would like to run the same | ||
-- tests locally or run M2 inside a container, use one of these commands from | ||
-- the top directory of the workshop repository: | ||
-- docker run -v "`pwd`":"/home/macaulay" ghcr.io/macaulay2/testbot --script tests/testbot.m2 | ||
-- docker run -v "`pwd`":"/home/macaulay" -it --entrypoint bash ghcr.io/macaulay2/testbot:latest | ||
|
||
-- Uncomment and edit the following line to add your project directories | ||
-- containing Macaulay2 source code files to the load path. Terminate each | ||
-- directory name with a "/". | ||
--path = join( { currentDirectory() | "src/singularities/", ... }, path ) | ||
|
||
-- Uncomment and edit the following lines to preload and check your package or | ||
-- to run a series of examples with every push on GitHub. | ||
--needsPackage "LocalRings" | ||
--check LocalRings | ||
--load "tests/example.m2" | ||
--capture get "tests/example.m2" | ||
|
||
-- The following lines automatically run every file in the "tests" directory. | ||
-- If you wish, you can change testDir to any other directory. | ||
testDir = currentDirectory() | "tests/" | ||
|
||
testFiles = select(readDirectory testDir, | ||
file -> match("\\.m2$", file) and file != "testbot.m2") | ||
printerr("Found ", toString(#testFiles), " test file(s) matching '", testDir, "*.m2'.") | ||
TEST(testFiles / (filename -> testDir | "/" | filename), FileName => true) | ||
|
||
-- workaround for https://github.com/Macaulay2/M2/issues/2835 | ||
importFrom_Core {"PackageIsLoaded"} | ||
User.PackageIsLoaded = true | ||
|
||
check(User, Verbose => true) |