diff --git a/.build/not-required/composer.json b/.build/not-required/composer.json new file mode 100644 index 0000000..139bf32 --- /dev/null +++ b/.build/not-required/composer.json @@ -0,0 +1,24 @@ +{ + "name": "ergebnis/composer-normalize-action", + "type": "library", + "description": "Provides a GitHub action for running ergebnis/composer-normalize.", + "homepage": "https://github.com/ergebnis/composer-normalize-action", + "license": "MIT", + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "require": { + "php": "^7.3" + }, + "config": { + "preferred-install": "dist", + "sort-packages": true + }, + "support": { + "issues": "https://github.com/ergebnis/composer-normalize-action/issues", + "source": "https://github.com/ergebnis/composer-normalize-action" + } +} diff --git a/.build/not-required/composer.lock b/.build/not-required/composer.lock new file mode 100644 index 0000000..1b9c5e3 --- /dev/null +++ b/.build/not-required/composer.lock @@ -0,0 +1,19 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "fab88dc8bd4860f2943141b6c195b9ba", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^7.3" + }, + "platform-dev": [] +} diff --git a/.build/composer.json b/.build/required/composer.json similarity index 100% rename from .build/composer.json rename to .build/required/composer.json diff --git a/.build/composer.lock b/.build/required/composer.lock similarity index 100% rename from .build/composer.lock rename to .build/required/composer.lock diff --git a/.github/settings.yml b/.github/settings.yml index 7c10cb7..ad19a91 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -14,10 +14,10 @@ branches: required_approving_review_count: 1 required_status_checks: contexts: - - "Docker image (no)" - - "Docker image (yes)" - - "GitHub Action (no)" - - "GitHub Action (yes)" + - "Docker image (not-required)" + - "Docker image (required)" + - "GitHub Action (not-required)" + - "GitHub Action (required)" strict: false restrictions: null diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index a6c52e6..3bb9a6d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -11,6 +11,12 @@ jobs: runs-on: "ubuntu-latest" + strategy: + matrix: + required: + - "not-required" + - "required" + env: DOCKER_IMAGE: "ergebnis/composer-normalize-action" @@ -22,19 +28,25 @@ jobs: run: "docker build --tag ${DOCKER_IMAGE}:latest ." - name: "Run Docker image with default behaviour" - run: "docker run --interactive --rm --workdir=/app --volume ${GITHUB_WORKSPACE}/.build:/app ${{ env.DOCKER_IMAGE }}:latest" + run: "docker run --interactive --rm --workdir=/app --volume ${GITHUB_WORKSPACE}/.build/${{ matrix.required }}:/app ${{ env.DOCKER_IMAGE }}:latest" - name: "Run Docker image with custom behaviour, specifying options" - run: "docker run --interactive --rm --workdir=/app --volume ${GITHUB_WORKSPACE}/.build:/app ${{ env.DOCKER_IMAGE }}:latest --diff --indent-size=1 --indent-style=space --no-update-lock" + run: "docker run --interactive --rm --workdir=/app --volume ${GITHUB_WORKSPACE}/.build/${{ matrix.required }}:/app ${{ env.DOCKER_IMAGE }}:latest --diff --indent-size=1 --indent-style=space --no-update-lock" - name: "Run Docker image with custom behaviour, specifying argument and options" - run: "docker run --interactive --rm --workdir=/app --volume ${GITHUB_WORKSPACE}:/app ${{ env.DOCKER_IMAGE }}:latest .build/composer.json --diff --indent-size=2 --indent-style=space --no-update-lock" + run: "docker run --interactive --rm --workdir=/app --volume ${GITHUB_WORKSPACE}:/app ${{ env.DOCKER_IMAGE }}:latest .build/${{ matrix.required }}/composer.json --diff --indent-size=2 --indent-style=space --no-update-lock" github-action: name: "GitHub Action" runs-on: "ubuntu-latest" + strategy: + matrix: + required: + - "not-required" + - "required" + env: DOCKER_IMAGE: "ergebnis/composer-normalize-action" @@ -42,8 +54,8 @@ jobs: - name: "Checkout" uses: "actions/checkout@v2.0.0" - - name: "Copy composer.json from .build into root directory" - run: "cp .build/composer.json composer.json" + - name: "Copy composer.json from .build/${{ matrix.required }} into root directory" + run: "cp .build/${{ matrix.required }}/composer.json composer.json" - name: "Run GitHub Action with default behavior" uses: "./" @@ -59,4 +71,4 @@ jobs: - name: "Run GitHub Action with custom behavior, specifying argument and options" uses: "./" with: - args: ".build/composer.json --diff --indent-size=1 --indent-style=tab --no-update-lock" + args: ".build/${{ matrix.required }}/composer.json --diff --indent-size=1 --indent-style=tab --no-update-lock" diff --git a/.gitignore b/.gitignore index 57872d0..48b8bf9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/vendor/ +vendor/ diff --git a/Makefile b/Makefile index 80cccee..b00c8ac 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,14 @@ it: docker ## Runs the docker target docker: ## Builds, tags, and runs the Docker image docker build --tag ${DOCKER_IMAGE} . # Run Docker image with default behaviour - docker run --interactive --rm --tty --workdir=/app --volume ${PWD}/.build:/app ${DOCKER_IMAGE}:latest + docker run --interactive --rm --tty --workdir=/app --volume ${PWD}/.build/not-required:/app ${DOCKER_IMAGE}:latest + docker run --interactive --rm --tty --workdir=/app --volume ${PWD}/.build/required:/app ${DOCKER_IMAGE}:latest # Run Docker image with custom behaviour, specifying options - docker run --interactive --rm --tty --workdir=/app --volume ${PWD}/.build:/app ${DOCKER_IMAGE}:latest --diff --indent-size=1 --indent-style=space --no-update-lock + docker run --interactive --rm --tty --workdir=/app --volume ${PWD}/.build/not-required:/app ${DOCKER_IMAGE}:latest --diff --indent-size=1 --indent-style=space --no-update-lock + docker run --interactive --rm --tty --workdir=/app --volume ${PWD}/.build/required:/app ${DOCKER_IMAGE}:latest --diff --indent-size=1 --indent-style=space --no-update-lock # Run Docker image with custom behaviour, specifying argument and options - docker run --interactive --rm --tty --workdir=/app --volume ${PWD}:/app ${DOCKER_IMAGE}:latest .build/composer.json --diff --indent-size=2 --indent-style=space --no-update-lock + docker run --interactive --rm --tty --workdir=/app --volume ${PWD}:/app ${DOCKER_IMAGE}:latest .build/not-required/composer.json --diff --indent-size=2 --indent-style=space --no-update-lock + docker run --interactive --rm --tty --workdir=/app --volume ${PWD}:/app ${DOCKER_IMAGE}:latest .build/required/composer.json --diff --indent-size=2 --indent-style=space --no-update-lock help: ## Displays this list of targets with descriptions @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'