From 67ad10e23c6459d700f30d5b4ae6d974e11a0b09 Mon Sep 17 00:00:00 2001 From: Matthias Andrasch <777278+mandrasch@users.noreply.github.com> Date: Sun, 28 Apr 2024 12:19:12 +0200 Subject: [PATCH] feat: add small gh action helper verifyProjectConfig.yaml --- .github/workflows/verifyProjectConfig.yaml | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/verifyProjectConfig.yaml diff --git a/.github/workflows/verifyProjectConfig.yaml b/.github/workflows/verifyProjectConfig.yaml new file mode 100644 index 0000000..0d2298c --- /dev/null +++ b/.github/workflows/verifyProjectConfig.yaml @@ -0,0 +1,41 @@ +# Small helper: Verify that craft project config is always valid by checking +# the install and apply CLI commands automatically after pushes to this repo + +on: + push: + branches: [development, main] + # Energy saving: Don't trigger this for updated README file only + paths-ignore: + - '**/README.md' + pull_request: + branches: [development, main] + paths-ignore: + - '**/README.md' + +name: verifyProjectConfig +jobs: + verifyProjectConfig: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # Install DDEV via https://github.com/ddev/github-action-setup-ddev + - uses: ddev/github-action-setup-ddev@v1 + + # Output installed ddev version + - run: ddev -v + + # Start the DDEV project, this will copy .env.example to .env + # and insert correct db connection settings for DDEV automagically + - run: ddev start + + # Install dependencies + - run: ddev composer install + - run: ddev npm install + + # Verify that craft installation works with dummy values + - run: ddev craft install/craft --interactive=0 --username=admin456 --password=NewPassword123 --email=admin@example.com --site-name=GitHubTest + + # Verify apply CLI commands works correctly as well + - run: ddev craft project-config/diff + - run: ddev craft project-config/apply