Skip to content

Commit

Permalink
Merge pull request #276 from lsst/tickets/DM-47403
Browse files Browse the repository at this point in the history
DM-47403: Fix problems in GitHub build workflow
  • Loading branch information
JeremyMcCormick authored Nov 5, 2024
2 parents ba7a0d6 + 8a89538 commit 8aad214
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 12 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
name: Build TAP Schema and Datalink

on: push
on:
push:
branches:
- main
tags:
- "*"
pull_request:

jobs:
build:
runs-on: ubuntu-latest

# Only do Docker builds of ticket branches and tagged releases.
if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/tickets/')

steps:
- name: Check out repo
uses: actions/checkout@v4
with:
# Need to clone everything for the git tags.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ datalink/*.zip
build
python/lsst_sdm_schemas.egg-info
__pycache__

# LSST version
python/lsst/sdm_schemas/version.py

# SCons build
config.log
7 changes: 0 additions & 7 deletions python/lsst/sdm_schemas/schemas/imsim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8092,13 +8092,6 @@ tables:
datatype: boolean
description: This flag is set if a trailed source contains edge pixels.
fits:tunit:
# - name: extendedness
# "@id": "#DiaSource.extendedness"
# datatype: double
# description: A measure of extendedness, computed by comparing an object's moment-based traced radius to
# the PSF moments. extendedness = 1 implies a high degree of confidence
# that the source is extended. extendedness = 0 implies a high degree of confidence
# that the source is point-like.
- name: ForcedSourceOnDiaObject
"@id": "#ForcedSourceOnDiaObject"
description: this is forcedSourceOnDiaObjectTable_tract in the butler repo
Expand Down
19 changes: 18 additions & 1 deletion tap-schema/build
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
#!/bin/bash -ex
ENVIRONMENT="$1"
GIT_TAG=`echo $GITHUB_REF | sed -E 's,refs/(heads|tags)/,,' | sed -E 's,/,-,g'`

echo "GITHUB_REF: $GITHUB_REF"
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
# Tag
GIT_TAG=$(echo $GITHUB_REF | sed -E 's,refs/tags/,,')
elif [[ "$GITHUB_REF" == refs/heads/* ]]; then
# Branch
GIT_TAG=$(echo $GITHUB_REF | sed -E 's,refs/heads/,,')
elif [[ "$GITHUB_REF" == refs/pull/* ]]; then
# Pull Request
GIT_TAG=$GITHUB_HEAD_REF
fi

GIT_TAG=$(echo $GIT_TAG | sed -E 's,/,-,g')
echo "GIT_TAG: $GIT_TAG"

shift

# Generate SQL files from Felis yaml files
Expand All @@ -17,6 +32,8 @@ done
docker build . -t lsstsqre/tap-schema-$ENVIRONMENT:$GIT_TAG
docker push lsstsqre/tap-schema-$ENVIRONMENT:$GIT_TAG

echo "Pushed Docker image: lsstsqre/tap-schema-$ENVIRONMENT:$GIT_TAG"

# Clean up any untracked files in the sql directory
# between the different runs of this script.
git clean -n
Expand Down

0 comments on commit 8aad214

Please sign in to comment.