Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use set -x for shell scripts #294

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
read_remote_cache: true
write_remote_cache: ${{ github.event_name == 'push' }}
- run: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Make Bash log commands and not silently ignore errors.
set -euxo pipefail

# The artifact name will contain the target triple, so the file name doesn't need to.
mv artifacts/docuum-x86_64-unknown-linux-gnu artifacts/docuum
Expand All @@ -36,8 +36,8 @@ jobs:
path: artifacts/docuum
if-no-files-found: error
- run: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Make Bash log commands and not silently ignore errors.
set -euxo pipefail

# The artifact name will contain the target triple, so the file name doesn't need to.
mv artifacts/docuum-x86_64-unknown-linux-musl artifacts/docuum
Expand All @@ -47,8 +47,8 @@ jobs:
path: artifacts/docuum
if-no-files-found: error
- run: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Make Bash log commands and not silently ignore errors.
set -euxo pipefail

# The artifact name will contain the target triple, so the file name doesn't need to.
mv artifacts/docuum-aarch64-unknown-linux-gnu artifacts/docuum
Expand All @@ -58,8 +58,8 @@ jobs:
path: artifacts/docuum
if-no-files-found: error
- run: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Make Bash log commands and not silently ignore errors.
set -euxo pipefail

# The artifact name will contain the target triple, so the file name doesn't need to.
mv artifacts/docuum-aarch64-unknown-linux-musl artifacts/docuum
Expand All @@ -73,16 +73,16 @@ jobs:
runs-on: windows-latest
steps:
- run: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Make Bash log commands and not silently ignore errors.
set -euxo pipefail

# The unit tests do not expect the files in `test_data` to have carriage returns added.
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v3
- run: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Make Bash log commands and not silently ignore errors.
set -euxo pipefail

# Install the appropriate version of Rust.
rustup toolchain install 1.76.0 # [ref:rust_1.76.0]
Expand Down Expand Up @@ -121,8 +121,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Make Bash log commands and not silently ignore errors.
set -euxo pipefail

# Install the appropriate version of Rust.
rustup toolchain install 1.76.0 # [ref:rust_1.76.0]
Expand Down Expand Up @@ -159,8 +159,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Make Bash log commands and not silently ignore errors.
set -euxo pipefail

# Run the installer script.
PREFIX=/tmp ./install.sh
Expand All @@ -173,8 +173,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Make Bash log commands and not silently ignore errors.
set -euxo pipefail

# Run the installer script.
PREFIX=/tmp ./install.sh
Expand All @@ -200,8 +200,8 @@ jobs:
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Make Bash log commands and not silently ignore errors.
set -euxo pipefail

# Install the appropriate version of Rust.
rustup toolchain install 1.76.0 # [ref:rust_1.76.0]
Expand Down Expand Up @@ -258,8 +258,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Make Bash log commands and not silently ignore errors.
set -euxo pipefail

# Run the Docker image to validate it. The image has already been published (since the
# `docker/build-push-action@v5` action unfortunately doesn't support importing multi-
Expand Down
2 changes: 1 addition & 1 deletion integration-test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
set -euxo pipefail

# See [ref:integration_test_step] for how to run this integration test.

Expand Down
4 changes: 2 additions & 2 deletions toast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ image: ubuntu:22.04
default: build
user: user
command_prefix: |
# Make Bash not silently ignore errors.
set -euo pipefail
# Make Bash log commands and not silently ignore errors.
set -euxo pipefail

# Load the Rust startup file, if it exists.
if [ -f "$HOME/.cargo/env" ]; then
Expand Down
Loading