Skip to content

Commit

Permalink
ci: trigger ci
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-the-nardo committed Nov 9, 2024
1 parent d79c367 commit 2da0d62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/build-spark-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
detect_changes:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
matrix: ${{ steps.extract-jobs.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -52,27 +52,22 @@ jobs:
unique_jobs=($(printf "%s\n" "${changed_jobs[@]}" | sort -u))
# Convert to JSON array
jobs_json=$(printf '%s\n' "${unique_jobs[@]}" | jq -R . | jq -s . | tr -d '\n')
# Check if jobs_json is empty and set accordingly
if [ "$jobs_json" = "[]" ]; then
echo "matrix={}" >> $GITHUB_OUTPUT
if [ ${#unique_jobs[@]} -eq 0 ]; then
jobs_json="[]"
else
# Set the matrix output with key 'job'
printf "matrix={\"job\": %s}\n" "$jobs_json" >> $GITHUB_OUTPUT
jobs_json=$(printf '%s\n' "${unique_jobs[@]}" | jq -R . | jq -s .)
fi
- name: Debug Matrix Output
run: echo "Matrix Output: ${{ steps.set-matrix.outputs.matrix }}"
# Set the matrix output with key 'job'
echo "matrix={\"job\": $jobs_json}" >> $GITHUB_OUTPUT
- name: Set matrix
id: set-matrix
run: |
echo "matrix=${{ steps.extract-jobs.outputs.matrix }}" >> $GITHUB_OUTPUT
# Optional: Remove the Debug step to prevent syntax errors
# - name: Debug Matrix Output
# run: echo "Matrix Output: ${{ steps.extract-jobs.outputs.matrix }}"

build_and_push:
needs: detect_changes
if: needs.detect_changes.outputs.matrix != '{}'
if: needs.detect_changes.outputs.matrix != '{"job":[]}'
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -105,7 +100,7 @@ jobs:

update_yaml:
needs: build_and_push
if: needs.detect_changes.outputs.matrix != '{}'
if: needs.detect_changes.outputs.matrix != '{"job":[]}'
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion spark-jobs/brazilian-finder/brazilian-finder_spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def spark_job(spark: SparkSession, params, *args, **kwargs):
ON e.email_lower LIKE CONCAT('%', w.word, '%')
""")

# Write to silver delta table as a .txt file with or iginal emails
# Write to silver delta table as a .txt file with or igin al emails
spark.sql(f"""
INSERT OVERWRITE TEXT.`{s3_output_path}`
SELECT email_tel
Expand Down

0 comments on commit 2da0d62

Please sign in to comment.