diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..ac9b983 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,22 @@ +name: Test Suite + +on: + - push + +jobs: + build-dir-exists: + runs-on: ubuntu-latest +# strategy: +# matrix: + steps: + - uses: actions/checkout@v2 + - run: | + cp test/satis.json . + mkdir dist + - name: Run action + uses: ./ + with: + token: ${{ github.token }} + - run: | + ls -lha public/ + name: Check satis build dir diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..85e7c1d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.idea/ diff --git a/action.yaml b/action.yaml index ff1f22e..c65648a 100644 --- a/action.yaml +++ b/action.yaml @@ -15,17 +15,24 @@ runs: steps: - env: COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ inputs.token }}"}}' + COMPOSER_HOME: /tmp/.satis-build run: | - echo '{"require": {"composer/satis": "dev-main"}}' > composer.json + mkdir /tmp/.satis-build + echo "{}" > /tmp/.satis-build/composer.json - composer require composer/satis --prefer-dist \ - --no-progress --no-interaction -o \ + composer g require composer/satis:dev-main --prefer-dist \ + --no-cache --no-progress --no-interaction -o \ --ignore-platform-reqs - php vendor/bin/satis build ${{ inputs.satis_config }} -n + php $COMPOSER_HOME/vendor/bin/satis build ${{ inputs.satis_config }} -n + + if cat ${{ inputs.satis_config }} | jq .archive -e; then + php $COMPOSER_HOME/vendor/bin/satis purge ${{ inputs.satis_config }} -n + fi + shell: bash - run: | - rm -rf composer.json composer.lock vendor/ + rm -rf $COMPOSER_HOME shell: bash branding: diff --git a/test/satis.json b/test/satis.json new file mode 100644 index 0000000..7e2e9ae --- /dev/null +++ b/test/satis.json @@ -0,0 +1,8 @@ +{ + "name": "cool/test", + "homepage": "https://satis-test", + "output-dir": "public", + "repositories": [ + { "type": "vcs", "url": "https://github.com/symfony/messenger" } + ] +}