Last active
May 26, 2022 06:30
-
-
Save goujonbe/d8a835045d6cb6624699989f70367570 to your computer and use it in GitHub Desktop.
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
package ci | |
import ( | |
"dagger.io/dagger" | |
"universe.dagger.io/bash" // import this package to execute bash commands inside a docker container | |
"universe.dagger.io/docker" // import this package to set up docker | |
) | |
dagger.#Plan & { | |
// configure the client so that dagger takes only the files it needs | |
client: filesystem: "./": read: { | |
contents: dagger.#FS | |
exclude: [ | |
"README.md", | |
"ci.cue", | |
"Vagrantfile", | |
"target/", | |
".vagrant/", | |
] | |
} | |
actions: { | |
// pull the official rust image and copy my code | |
deps: docker.#Build & { | |
steps: [ | |
docker.#Pull & { | |
source: "rust:1.61.0" | |
}, | |
docker.#Copy & { | |
contents: client.filesystem."./".read.contents | |
dest: "/src" | |
}, | |
] | |
} | |
// run the test suite inside the docker container | |
test: bash.#Run & { | |
input: deps.output | |
workdir: "/src" | |
script: contents: #""" | |
cargo test | |
"""# | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment