Support pushing to stacks #49
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: bladedown | |
- name: Download test environment | |
run: | | |
git clone https://github.com/hydephp/hyde.git --depth 1 | |
cp bladedown/tests/runner/composer.json hyde/composer.json | |
rm hyde/_pages/* | |
- name: Configure pull request version | |
if: github.event_name == 'pull_request' | |
run: | | |
sed -i "s/hyde\/bladedown\": \"dev-main\"/hyde\/bladedown\": \"dev-${GITHUB_SHA}\"/g" hyde/composer.json | |
- name: Install test environment | |
working-directory: hyde | |
run: composer install --no-interaction --no-progress --no-dev | |
- name: Copy test fixtures | |
run: | | |
cp -r bladedown/tests/fixtures/. hyde/_pages | |
cp -r bladedown/tests/runner/resources/. hyde/resources | |
- name: Test site can be built | |
working-directory: hyde | |
run: php hyde build --no-ansi | |
- name: Assert pages were created | |
run: php bladedown/tests/bin/test.php | |
- name: Upload built site | |
uses: actions/upload-artifact@v4 | |
with: | |
name: site | |
path: hyde/_site |