Skip to content

Commit

Permalink
Tweak Github Actions (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
shehabgamin authored Feb 2, 2025
1 parent 9a9b3ee commit 26decaf
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 77 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,41 @@ jobs:

- uses: ./.github/actions/setup-rust

- name: Format check
- name: Run Format Check
run: cargo +nightly fmt -- --check

- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Test
- name: Run Cargo Test
env:
CARGO_BUILD_JOBS: 1
run: cargo test

- name: Build Python package
- name: Build Python Package
uses: PyO3/maturin-action@v1

- name: Upload Python package
- name: Upload Python Package
uses: actions/upload-artifact@v4
with:
name: python-package
path: target/wheels
retention-days: 1

spark-tests:
name: Spark tests
name: Spark Tests
uses: ./.github/workflows/spark-tests.yml
needs:
- build

python-build:
name: Python build
name: Python Build
uses: ./.github/workflows/python-build.yml
needs:
- build

docs-build:
name: Docs build
name: Docs Build
uses: ./.github/workflows/docs-build.yml
strategy:
matrix:
Expand All @@ -63,7 +65,7 @@ jobs:
version: main

docs-deploy:
name: Docs deploy
name: Docs Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: ./.github/workflows/docs-deploy.yml
strategy:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docs build
name: Docs Build

# This workflow uses the following variable(s) from the environment:
# - FATHOM_SITE_ID (optional)
Expand All @@ -16,8 +16,8 @@ on:
required: true

jobs:
build:
name: Build
docs-build:
name: Docs Build
runs-on: ubuntu-latest
environment: ${{ inputs.stage != 'test' && format('docs/{0}', inputs.stage) || '' }}
steps:
Expand All @@ -38,30 +38,30 @@ jobs:
node-version: "22"
cache: pnpm

- name: Install dependencies
- name: Install Dependencies
run: pnpm install

- name: Run code formatter
- name: Run Code Formatter
env:
FORMAT_OPTIONS: --check
run: pnpm run format

- name: Run code linter
- name: Run Code Linter
run: pnpm run lint

- name: Download Python package
- name: Download Python Package
uses: actions/download-artifact@v4
with:
name: python-package
path: target/wheels

- name: Build Python documentation
- name: Build Python Documentation
run: |
hatch env create docs
hatch run docs:install-pysail
hatch run docs:build
- name: Build VitePress site
- name: Build VitePress Site
env:
SAIL_SITE_URL: "https://${{ inputs.stage == 'prod' && 'docs' || 'docs.dev' }}.lakesail.com/sail/${{ inputs.version }}/"
# The Fathom Analytics script will not be added if the site ID is not set.
Expand All @@ -76,7 +76,7 @@ jobs:
pnpm run docs:build
shell: bash

- name: Upload artifact
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: docs-dist-${{ inputs.stage }}-${{ inputs.version }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docs deploy
name: Docs Deploy

# This workflow uses the following variable(s) from the environment:
# - AWS_REGION
Expand All @@ -19,26 +19,26 @@ on:
required: true

jobs:
deploy:
name: Deploy
docs-deploy:
name: Docs Deploy
runs-on: ubuntu-latest
environment: docs/${{ inputs.stage }}
permissions:
id-token: write
steps:
- name: Configure AWS credentials
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}

- name: Download artifact
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: docs-dist-${{ inputs.stage }}-${{ inputs.version }}
path: docs/.vitepress/dist

- name: Display artifact directory structure
- name: Display Artifact Directory Structure
run: find . -type f
working-directory: docs/.vitepress/dist

Expand All @@ -48,7 +48,7 @@ jobs:
run: |
aws s3 sync docs/.vitepress/dist "${S3_URI}" --delete
- name: Invalidate CloudFront cache
- name: Invalidate CloudFront Cache
env:
CLOUDFRONT_DISTRIBUTION_ID: ${{ vars.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
CLOUDFRONT_PATH: /sail/${{ inputs.version }}/*
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docs-tag.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docs tag push
name: Docs Tag Push

on:
push:
Expand All @@ -13,7 +13,7 @@ jobs:
outputs:
version: ${{ steps.info.outputs.version }}
steps:
- name: Collect release information
- name: Collect Release Information
id: info
env:
GIT_TAG_REF: ${{ github.ref }}
Expand Down Expand Up @@ -52,18 +52,18 @@ jobs:

- uses: ./.github/actions/setup-rust

- name: Build Python package
- name: Build Python Package
uses: PyO3/maturin-action@v1

- name: Upload Python package
- name: Upload Python Package
uses: actions/upload-artifact@v4
with:
name: python-package
path: target/wheels
retention-days: 1

docs-build:
name: Build
name: Docs Build
uses: ./.github/workflows/docs-build.yml
strategy:
matrix:
Expand All @@ -76,7 +76,7 @@ jobs:
version: ${{ needs.setup.outputs.version }}

docs-deploy:
name: Deploy
name: Docs Deploy
uses: ./.github/workflows/docs-deploy.yml
strategy:
max-parallel: 1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gold-data-script-validation.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Gold data script validation
name: Gold Data Script Validation

on:
push:
Expand Down Expand Up @@ -32,11 +32,11 @@ jobs:

- uses: ./.github/actions/setup-rust

- name: Bootstrap gold data
- name: Bootstrap Gold Data
run: |
scripts/spark-gold-data/bootstrap.sh
- name: Update gold data
- name: Update Gold Data
run: |
env SAIL_UPDATE_GOLD_DATA=1 cargo test
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/gold-data.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Gold data
name: Gold Data

on:
push:
Expand All @@ -23,7 +23,7 @@ jobs:
path: tmp/baseline
ref: ${{ steps.baseline.outputs.sha }}

- name: Generate gold data report
- name: Generate Gold Data Report
env:
REPORT_GIT_REF_BEFORE: ${{ steps.baseline.outputs.ref }}
REPORT_GIT_REF_AFTER: ${{ github.ref }}
Expand All @@ -32,14 +32,14 @@ jobs:
scripts/common-gold-data/report.sh . tmp/baseline > tmp/report/report.md
cat tmp/report/report.md >> "$GITHUB_STEP_SUMMARY"
- name: Save pull request number
- name: Save Pull Request Number
if: github.event_name == 'pull_request'
env:
NUMBER: ${{ github.event.number }}
run: |
echo "$NUMBER" > tmp/report/pull-request.txt
- name: Upload report
- name: Upload Report
uses: actions/upload-artifact@v4
with:
name: gold-data-report
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Python build
name: Python Build

on:
workflow_call:

jobs:
build:
name: Build
python-build:
name: Python Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -17,21 +17,21 @@ jobs:
- name: Install Hatch
uses: pypa/hatch@install

- name: Format check
- name: Format Check
run: hatch fmt --check

- name: Download Python package
- name: Download Python Package
uses: actions/download-artifact@v4
with:
name: python-package
path: target/wheels

- name: Set up Hatch environment
- name: Set Up Hatch Environment
run: |
hatch env create
hatch run install-pysail
- name: Verify package version
- name: Verify Package Version
run: |
declared_version="$(hatch version)"
actual_version="$(hatch run python -c 'import pysail; print(pysail.__version__)')"
Expand All @@ -42,5 +42,5 @@ jobs:
exit 1
fi
- name: Run tests
- name: Run Tests
run: hatch run pytest --pyargs pysail
Loading

0 comments on commit 26decaf

Please sign in to comment.