galaxyproject/brc-analytics (opens in new tab)
7 workflows
Check pull request title
.github/workflows/check-pr-title.yml (opens in new tab)Triggers
pull_request
Jobs
| Job | Runs on | Steps | Actions used |
|---|---|---|---|
| check-pr-title | ubuntu-latest | 5 | actions/checkout@v4 actions/setup-node@v4 actions/cache@v4 ./.github/actions/check-input-commit-message |
Raw YAML
name: Check pull request title
on:
pull_request:
types: [edited, opened, synchronize, reopened]
jobs:
check-pr-title:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22.12.0"
- name: Cache npm cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Check pull request title for Conventional Commits format and GitHub issue number
uses: ./.github/actions/check-input-commit-message
with:
message: ${{ github.event.pull_request.title }}
Last fetched:
Deploy to S3 and CloudFront
.github/workflows/dev-deploy.yml (opens in new tab)Triggers
push
Jobs
| Job | Runs on | Steps | Actions used |
|---|---|---|---|
| build-and-deploy | ubuntu-latest | 7 | actions/checkout@v3 actions/setup-node@v3 aws-actions/configure-aws-credentials@v4 |
Raw YAML
name: Deploy to S3 and CloudFront
on:
push:
branches: [main]
permissions:
id-token: write
contents: read
concurrency:
group: dev-deploy
cancel-in-progress: false
jobs:
build-and-deploy:
if: github.repository == 'galaxyproject/brc-analytics'
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "22.12.0"
- name: Install Dependencies
run: npm ci
- name: Build Next.js Site
env:
NEXT_PUBLIC_BASE_PATH: ""
run: npm run build:dev
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.DEV_AWS_ACCOUNT_ID }}:role/${{ secrets.DEV_AWS_ROLE_NAME }}
role-session-name: ${{ secrets.DEV_ROLE_SESSION_NAME }}
aws-region: ${{ secrets.DEV_AWS_REGION }}
- name: Sync to S3
env:
SRCDIR: out/
run: |
aws s3 sync $SRCDIR s3://${{ secrets.DEV_S3_BUCKET_NAME }} --delete
- name: Invalidate CloudFront Cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.DEV_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"
Last fetched:
Publish Release
.github/workflows/publish-release.yml (opens in new tab)Triggers
workflow_dispatch
Jobs
| Job | Runs on | Steps | Actions used |
|---|---|---|---|
| publish-release | ubuntu-latest | 8 | actions/checkout@v4 actions/setup-node@v4 |
Raw YAML
name: Publish Release
on:
workflow_dispatch:
inputs:
release_id:
description: "Tag name of the draft release to publish (e.g., v0.19.0)"
required: true
permissions:
actions: write
contents: write
pull-requests: write
jobs:
publish-release:
if: github.repository == 'galaxyproject/brc-analytics'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.12.0"
- name: Configure git
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Get release info
id: get_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_ID: ${{ github.event.inputs.release_id }}
run: |
RELEASE_TAG=$(gh release view $RELEASE_ID --json tagName -q '.tagName')
VERSION=${RELEASE_TAG#v}
echo "tag=$RELEASE_TAG" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Merge main to production
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Fetch all branches
git fetch origin main production
# Checkout production and merge main
git checkout production
git merge origin/main -m "Release ${{ steps.get_release.outputs.tag }}: merge main to production"
# Move the release tag to point to this merge commit so git describe
# shows the correct version (e.g., "v0.21.0" not "v0.21.0-1-gXXX")
git tag -f ${{ steps.get_release.outputs.tag }}
# Push production branch and updated tag
git push origin production
git push origin ${{ steps.get_release.outputs.tag }} --force
- name: Trigger production deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# GITHUB_TOKEN pushes don't trigger workflows, so we manually trigger the deploy
gh workflow run publish.yml --ref production
- name: Publish release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_ID: ${{ github.event.inputs.release_id }}
run: |
gh release edit "$RELEASE_ID" --draft=false
- name: Bump main to next development version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
CURRENT_VERSION="${{ steps.get_release.outputs.version }}"
# Parse version components
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
# Always do minor bump: 0.19.0 → 0.20.0
NEXT_VERSION="${MAJOR}.$((MINOR + 1)).0"
echo "Bumping from $CURRENT_VERSION to $NEXT_VERSION"
BRANCH_NAME="release/bump-to-$NEXT_VERSION"
# Create branch from main
git checkout main
git pull origin main
git checkout -b "$BRANCH_NAME"
# Update version
npm version $NEXT_VERSION --no-git-tag-version
# Commit changes
git add package.json package-lock.json
git commit -m "chore: bump version to $NEXT_VERSION for next development cycle [skip ci]"
# Push branch
git push -u origin "$BRANCH_NAME"
# Create PR
gh pr create \
--title "chore: bump version to $NEXT_VERSION" \
--body "Automated version bump after release ${{ steps.get_release.outputs.tag }}.
- \`production\` branch = ${{ steps.get_release.outputs.version }} (stable)
- \`main\` branch = $NEXT_VERSION (development)" \
--head "$BRANCH_NAME" \
--base main
Last fetched:
Deploy to S3 and CloudFront
.github/workflows/publish.yml (opens in new tab)Triggers
push workflow_dispatch
Jobs
| Job | Runs on | Steps | Actions used |
|---|---|---|---|
| build-and-deploy | ubuntu-latest | 7 | actions/checkout@v3 actions/setup-node@v3 aws-actions/configure-aws-credentials@v3 |
Raw YAML
name: Deploy to S3 and CloudFront
on:
push:
branches:
# - main # todo, consolidate auth approach and merge dev-deploy into this.
- production
workflow_dispatch:
branches:
- production
concurrency:
group: prod-deploy
cancel-in-progress: false
jobs:
build-and-deploy:
if: github.repository == 'galaxyproject/brc-analytics'
runs-on: ubuntu-latest
environment: ${{ github.ref == 'refs/heads/production' && 'production' || 'development' }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "22.12.0"
- name: Install Dependencies
run: npm ci
- name: Build Next.js Site
env:
NEXT_PUBLIC_BASE_PATH: ""
run: npm run build:prod
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Sync to S3
env:
SRCDIR: out/
run: |
aws s3 sync $SRCDIR s3://${{ secrets.S3_BUCKET_NAME }} --delete
- name: Invalidate CloudFront Cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"
Last fetched:
Release Drafter
.github/workflows/release-drafter.yml (opens in new tab)Triggers
push pull_request_target workflow_dispatch
Jobs
| Job | Runs on | Steps | Actions used |
|---|---|---|---|
| update_release_draft | ubuntu-latest | 1 | release-drafter/release-drafter@v6 |
Raw YAML
name: Release Drafter
on:
push:
branches:
- main
pull_request_target:
types: [opened, reopened, synchronize]
workflow_dispatch:
inputs:
version:
description: "Release version"
required: true
permissions:
contents: read
jobs:
update_release_draft:
permissions:
contents: write
pull-requests: write
if: github.repository == 'galaxyproject/brc-analytics'
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
with:
config-name: release-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Last fetched:
Triggers
pull_request
Jobs
| Job | Runs on | Steps | Actions used |
|---|---|---|---|
| e2e-tests | ubuntu-latest | 8 | actions/checkout@v4 actions/setup-node@v4 actions/cache@v4 actions/upload-artifact@v4 |
| run-checks | ubuntu-latest | 14 | actions/checkout@v4 actions/setup-node@v4 actions/cache@v4 actions/setup-python@v5 |
| api-tests | ubuntu-latest | 10 | actions/checkout@v6 actions/setup-python@v6 astral-sh/setup-uv@v7 |
Raw YAML
name: Run checks
on: [pull_request]
jobs:
e2e-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22.12.0"
- name: Cache npm cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Build production bundle
run: npm run build:local
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Run e2e tests
run: npm run test:e2e
- name: Upload test results
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: playwright-report/
retention-days: 7
run-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22.12.0"
- name: Cache npm cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Run Prettier
run: npm run check-format
- name: Run Linter (ESLint)
run: npm run lint
- name: Type Check
run: npx tsc --noEmit
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12.4"
cache: "pip"
cache-dependency-path: "./catalog/build/py/requirements.txt"
- name: Install Python dependencies
run: pip install -r ./catalog/build/py/requirements.txt
- name: Run linkml-lint
# Run linting on the LinkML schemas, to enforce conventions such as in naming, and to catch simple errors.
run: npm run lint-schema
- name: Test LinkML Python generation
# Generate Python code from the main LinkML schemas, discarding the output; this will catch more subtle errors such as references to nonexistent elements.
run: npm run test-gen-python
- name: Validate BRC catalog files
# Validate the catalog source files against their corresponding LinkML schemas.
run: npm run validate-brc-catalog
- name: Validate GA2 catalog files
# Validate the GA2 catalog source files.
run: npm run validate-ga2-catalog
- name: poetry lint
# Validate the GA2 catalog source files.
run: poetry check -P catalog/py_package/
api-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Create backend .env file
run: cp backend/api/.env.example backend/api/.env
- name: Build catalog data
run: |
npm ci
npm run build-brc-db
- name: Start backend services
run: |
cd backend
docker compose up -d --build
docker compose logs
- name: Wait for services to be healthy
run: |
timeout 60 bash -c 'until curl -s http://localhost:8080/api/v1/health | grep -q healthy; do sleep 2; done'
- name: Run API smoke tests
run: |
cd backend/api
uv run --extra dev pytest tests/ -v
- name: Show logs on failure
if: failure()
run: |
cd backend
docker compose logs
- name: Stop backend services
if: always()
run: |
cd backend
docker compose down -v
Last fetched:
Update brc data catalog
.github/workflows/update-catalog.yml (opens in new tab)Triggers
schedule workflow_dispatch
Jobs
| Job | Runs on | Steps | Actions used |
|---|---|---|---|
| update-catalog | ubuntu-latest | 7 | actions/setup-python@v5 actions/checkout@v4 peter-evans/create-pull-request@v7 |
Raw YAML
name: Update brc data catalog
on:
schedule:
# At 10:00 on Sunday
- cron: "0 10 * * 0"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
update-catalog:
if: github.repository == 'galaxyproject/brc-analytics'
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
architecture: "x64"
- name: Checkout
uses: actions/checkout@v4
- name: Install python dependencies
run: pip install -r ./catalog/build/py/requirements.txt
- name: Install npm dependencies
run: npm ci
- name: Run catalog script
run: npm run build-brc-from-ncbi
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "chore: update data catalog ${{ steps.date.outputs.date }}"
commit-message: "chore: update data catalog ${{ steps.date.outputs.date }}"
Last fetched: