Skip to content

Commit

Permalink
ci: testing is_release flag
Browse files Browse the repository at this point in the history
  • Loading branch information
shairez committed Jul 28, 2024
1 parent b35c13e commit e905784
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
build-insights: ${{ steps.cache-insights.outputs.cache-hit != 'true' }}
build-unit: ${{ steps.cache-unit.outputs.cache-hit != 'true' }}
build-e2e: ${{ steps.cache-e2e.outputs.cache-hit != 'true' }}
is_release: ${{ steps.check_changesets.outputs.is_release }}

steps:
- name: Branch
Expand All @@ -72,6 +73,34 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Check for removed .mock_changesets files and directory contents
id: check_changesets
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
is_release=false
removed_files="${{ github.event.head_commit.removed }}"
echo "Removed files: $removed_files"
md_file_removed=false
for file in $removed_files; do
if [[ $file == .mock_changesets/*.md ]]; then
md_file_removed=true
break
fi
done
if [ -d ".mock_changesets" ]; then
md_files=$(find .mock_changesets -name '*.md')
if [ -z "$md_files" ] && [ "$md_file_removed" = true ]; then
is_release=true
fi
elif [ "$md_file_removed" = true ]; then
is_release=true
fi
echo "is_release=${is_release}" >> $GITHUB_ENV
- run: jq .scripts package.json > scripts.json

- name: 'check cache: qwik'
Expand Down Expand Up @@ -138,6 +167,14 @@ jobs:
path: e2e-tests-completed.txt
key: ${{ hashfiles('others-key.txt', 'starters/e2e/**/*', 'starters/apps/e2e/**/*') }}

log_is_release:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
needs: changes
steps:
- name: Log is_release
run: echo "is_release=${{ needs.changes.outputs.is_release }}"

############ BUILD Qwik ############
build-qwik:
if: needs.changes.outputs.build-qwik == 'true'
Expand Down
1 change: 1 addition & 0 deletions .mock_changesets/fake_change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Fake change

0 comments on commit e905784

Please sign in to comment.