Skip to content

Commit

Permalink
Added test & cleaner action working dir
Browse files Browse the repository at this point in the history
  • Loading branch information
VeryStrongFingers committed Jul 10, 2021
1 parent a159c8b commit 8165a45
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.idea/
17 changes: 12 additions & 5 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions test/satis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "cool/test",
"homepage": "https://satis-test",
"output-dir": "public",
"repositories": [
{ "type": "vcs", "url": "https://github.com/symfony/messenger" }
]
}

0 comments on commit 8165a45

Please sign in to comment.