From b3b993f2ae11edd38918784f909e89bf72105400 Mon Sep 17 00:00:00 2001 From: Edwin Kofler Date: Mon, 27 Nov 2023 03:07:24 -0800 Subject: [PATCH] test: Add regression test for non-existent env var --- .editorconfig | 3 +++ .github/workflows/tests.yaml | 17 +++++++++++++++++ .pre-commit-config.yaml | 1 - tests/works_without_env | 5 +++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tests.yaml create mode 100755 tests/works_without_env diff --git a/.editorconfig b/.editorconfig index 0d5fa09..a0cada3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,5 +13,8 @@ charset = utf-8 [*.sh] indent_size = 2 +[*.{yaml,yml}] +indent_size = 2 + [Makefile] indent_style = tab diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..0a7f5f4 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,17 @@ +--- +name: 'Run Tests' + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: 'Execute tests' + run: './run_tests' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 32694a7..445d66b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,5 +20,4 @@ repos: additional_dependencies: - mdformat-gfm - mdformat-toc - # EOF diff --git a/tests/works_without_env b/tests/works_without_env new file mode 100755 index 0000000..980d910 --- /dev/null +++ b/tests/works_without_env @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +# + +unset -v XDG_DATA_HOME +make install