Skip to content

Commit

Permalink
Merge pull request #194 from stepchowfun/command-prefix
Browse files Browse the repository at this point in the history
Simplify the toastfile with some new Toast features
  • Loading branch information
stepchowfun authored Aug 22, 2021
2 parents 8fd5882 + 8820b52 commit 01416e3
Showing 1 changed file with 6 additions and 48 deletions.
54 changes: 6 additions & 48 deletions toast.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
image: ubuntu:20.04
default: build
user: user
command_prefix: set -euo pipefail
tasks:
install_packages:
description: Install system packages.
user: root
command: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Install the following packages:
#
# - build-essential - Used for linking the binary
Expand Down Expand Up @@ -35,19 +35,15 @@ tasks:
description: Install Tagref, a reference checking tool.
dependencies:
- install_packages
user: root
command: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Install Tagref using the official installer script.
curl https://raw.githubusercontent.com/stepchowfun/tagref/main/install.sh -LSfs | sh
create_user:
description: Create a user who doesn't have root privileges.
user: root
command: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Create a user named `user` with a home directory.
adduser --disabled-password --gecos '' user
Expand All @@ -56,11 +52,7 @@ tasks:
dependencies:
- install_packages
- create_user
user: user
command: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Install stable Rust. [tag:rust_1_53_0]
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
-y \
Expand All @@ -87,11 +79,7 @@ tasks:
input_paths:
- Cargo.lock
- Cargo.toml
user: user
command: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Add Rust tools to `$PATH`.
. $HOME/.cargo/env
Expand Down Expand Up @@ -120,11 +108,7 @@ tasks:
- fetch_crates
input_paths:
- src
user: user
command: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Add Rust tools to `$PATH`.
. $HOME/.cargo/env
Expand All @@ -135,11 +119,7 @@ tasks:
description: Run the test suite.
dependencies:
- build
user: user
command: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Add Rust tools to `$PATH`.
. $HOME/.cargo/env
Expand All @@ -158,11 +138,7 @@ tasks:
- .git
- artifacts
- target
user: user
command: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Add Rust tools to `$PATH`.
. $HOME/.cargo/env
Expand Down Expand Up @@ -199,11 +175,7 @@ tasks:
description: Run the program.
dependencies:
- build
user: user
command: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Add Rust tools to `$PATH`.
. $HOME/.cargo/env
Expand All @@ -218,11 +190,7 @@ tasks:
- src
output_paths:
- src
user: user
command: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Add Rust tools to `$PATH`.
. $HOME/.cargo/env
Expand All @@ -240,11 +208,7 @@ tasks:
- src
output_paths:
- artifacts
user: user
command: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Add Rust tools to `$PATH`.
. $HOME/.cargo/env
Expand Down Expand Up @@ -274,10 +238,8 @@ tasks:
cache: false
mount_paths:
- /var/run/docker.sock
user: root
command: |
# Make Bash not silently ignore errors.
set -euo pipefail
# This will be called when the task finishes, regardless of whether it succeeded.
function cleanup {
# Delete the container created below to run the integration tests.
Expand Down Expand Up @@ -307,11 +269,7 @@ tasks:
input_paths:
- README.md
- src
user: user
command: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Add Rust tools to `$PATH`.
. $HOME/.cargo/env
Expand Down

0 comments on commit 01416e3

Please sign in to comment.