From f100e25881abe69adc8f96cf5b22689d6a55fbf3 Mon Sep 17 00:00:00 2001 From: FarisZR <35614734+FarisZR@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:28:53 +0200 Subject: [PATCH] add pr-test workflow --- .github/workflows/pr-test.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/pr-test.yml diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml new file mode 100644 index 0000000..5d5f170 --- /dev/null +++ b/.github/workflows/pr-test.yml @@ -0,0 +1,35 @@ +name: Test docker-compose files + +on: + pull_request: + paths: + - '**/docker-compose.yml' + - '**/docker-compose.yaml' + +## Thanks Bing AI! + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Compose + uses: ndeloof/install-compose-action@v0.0.1 + - run: docker compose --version + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v43 + with: + files: | + **/docker-compose.yml + **/docker-compose.yaml + - name: Test docker-compose files + run: | + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + echo "Testing $file" + docker compose -f $file config + docker compose -f $file pull + done \ No newline at end of file