-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge overleaf-2024-06-17-1638 into main
- Loading branch information
Showing
201 changed files
with
110,662 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Thank you for contributing to lsst-texmf! | ||
|
||
Please review our [developer documentation](https://lsst-texmf.lsst.io/developer.html) that covers updating the class and style files, bibliographies, examples, and documentation. | ||
|
||
https://lsst-texmf.lsst.io/developer.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install dependancies and linters | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install uv | ||
python -m uv pip install --system pybtex | ||
python -m uv pip install --system -r requirements.txt | ||
- name: Run pybtex | ||
run: make test-pybtex | ||
|
||
- name: Run author check | ||
run: make test-authors | ||
|
||
- name: Run pytest | ||
env: | ||
PYTHONPATH: bin | ||
run: pytest | ||
|
||
- name: Run as test generateBibfile.py | ||
run: | | ||
bin/generateBibfile.py generated.bib | ||
wc -l generated.bib | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install uv | ||
python -m uv pip install --system -r docs/requirements.txt | ||
python -m uv pip install --system ltd-conveyor | ||
- name: Pull existing images | ||
run: | | ||
docker pull lsstsqre/lsst-texmf:base || true | ||
docker pull lsstsqre/lsst-texmf:dependencies || true | ||
docker pull lsstsqre/lsst-texmf:latest || true | ||
- name: Build the base Docker image | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build \ | ||
--build-arg BUILDKIT_INLINE_CACHE=1 \ | ||
--target base \ | ||
--cache-from=lsstsqre/lsst-texmf:base \ | ||
--tag lsstsqre/lsst-texmf:base . | ||
- name: Build the dependencies Docker image | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build \ | ||
--build-arg BUILDKIT_INLINE_CACHE=1 \ | ||
--target dependencies \ | ||
--cache-from=lsstsqre/lsst-texmf:dependencies \ | ||
--tag lsstsqre/lsst-texmf:dependencies . | ||
- name: Build the runtime Docker image | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build \ | ||
--build-arg BUILDKIT_INLINE_CACHE=1 \ | ||
--target runtime \ | ||
--cache-from=lsstsqre/lsst-texmf:latest \ | ||
--tag lsstsqre/lsst-texmf:latest . | ||
- name: Compile test and example documents | ||
run: | | ||
docker run --rm -v `pwd`:/workspace -w /lsst-texmf lsstsqre/lsst-texmf:latest sh -c 'make all && cp *.pdf /workspace' | ||
- name: Test generateAcronyms.py | ||
run: | | ||
docker run -w /lsst-texmf lsstsqre/lsst-texmf:latest sh -c "make test-acronyms" | ||
- name: Compile documentation | ||
run: | | ||
make docs | ||
- name: Upload documentation | ||
if: ${{ github.event_name == 'push' }} | ||
env: | ||
LTD_PASSWORD: ${{ secrets.LTD_PASSWORD }} | ||
LTD_USERNAME: ${{ secrets.LTD_USERNAME }} | ||
run: | | ||
ltd upload --product lsst-texmf --gh --dir docs/_build/html | ||
- name: Log into Docker Hub | ||
run: echo ${{ secrets.DOCKER_TOKEN }} | docker login --username ${{ secrets.DOCKER_USERNAME }} --password-stdin | ||
|
||
- name: Push Docker images | ||
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} | ||
run: | | ||
docker push lsstsqre/lsst-texmf:base | ||
docker push lsstsqre/lsst-texmf:dependencies | ||
docker push lsstsqre/lsst-texmf:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# This workflow runs weekly. Its purpose is to rebuild the base Docker images | ||
# to get the latest security updates and versions of Python dependencies | ||
# (otherwise the regular CI workflow will continue to use the existing base | ||
# images). | ||
|
||
name: Refresh Docker cache | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 4 * * MON" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build the dependencies Docker image without caching | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build \ | ||
--build-arg BUILDKIT_INLINE_CACHE=1 \ | ||
--target dependencies \ | ||
--no-cache \ | ||
--tag lsstsqre/lsst-texmf:dependencies . | ||
- name: Build the base Docker image (for pushing as a separate tag) | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build \ | ||
--build-arg BUILDKIT_INLINE_CACHE=1 \ | ||
--target base \ | ||
--tag lsstsqre/lsst-texmf:base . | ||
- name: Log into Docker Hub | ||
run: echo ${{ secrets.DOCKER_TOKEN }} | docker login --username ${{ secrets.DOCKER_USERNAME }} --password-stdin | ||
|
||
- name: Push Docker images | ||
run: | | ||
docker push lsstsqre/lsst-texmf:base | ||
docker push lsstsqre/lsst-texmf:dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Check Python formatting | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
call-workflow: | ||
uses: lsst/rubin_workflows/.github/workflows/formatting.yaml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: generatebib | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# UTC min hour day month dayOfWeek | ||
- cron: '03 6 * * *' | ||
|
||
jobs: | ||
bib: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install uv | ||
python -m uv pip install --system pyyaml algoliasearch latexcodec pybtex | ||
- name: Generate bibfile | ||
run: | | ||
wc -l texmf/bibtex/bib/lsst.bib | ||
make lsst.bib | ||
wc -l texmf/bibtex/bib/lsst.bib | ||
- name: Check diff | ||
run: | # set an environment variable | ||
if git diff --exit-code; then | ||
echo "CHANGED=false" >> ${GITHUB_ENV} | ||
echo "No changes - no PR" | ||
else | ||
echo "CHANGED=true" >> ${GITHUB_ENV} | ||
echo "Git changes - should make PR" | ||
fi | ||
- name: Commit new bib | ||
if: env.CHANGED == 'true' | ||
run: | | ||
git config user.name github-actions | ||
git config user.email github-actions@github.com | ||
git commit -m " generated lsst.bib " texmf/bibtex/bib/lsst.bib | ||
- name: Create Pull Request | ||
id: cpr | ||
if: env.CHANGED == 'true' | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.WOM_UPDATEBIB_PAT }} | ||
branch: update-bibfile | ||
branch-suffix: short-commit-hash | ||
title: Automatic bibfile update | ||
commit-message: bibfile update | ||
body: Update bibfile from lsst.io and etc/static_entries.bib | ||
|
||
- name: Enable Pull Request Automerge | ||
if: steps.cpr.outputs.pull-request-operation == 'created' | ||
uses: peter-evans/enable-pull-request-automerge@v3 | ||
with: | ||
token: ${{ secrets.WOM_UPDATEBIB_PAT }} | ||
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | ||
merge-method: merge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
call-workflow: | ||
uses: lsst/rubin_workflows/.github/workflows/lint.yaml@main | ||
ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: chartboost/ruff-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: Check that 'main' is not merged into the development branch | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
call-workflow: | ||
uses: lsst/rubin_workflows/.github/workflows/rebase_checker.yaml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Lint YAML Files | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
cache: "pip" | ||
|
||
- name: Install | ||
run: pip install yamllint | ||
|
||
- name: Run linter | ||
run: yamllint . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Dockerized lsst-texmf | ||
# | ||
# This is a multi-stage docker build composed of three images: | ||
# 1. "base" is an official Python image with additional system dependencies | ||
# (such as texlive) installed via the "docker/install-base-packages.sh" | ||
# script. Add additional apt-get dependencies through that script. | ||
# 2. "dependencies" installs the Python dependencies defined in | ||
# requirements.txt. | ||
# 3. "runtime" is the final image for end users. It is based on the "base" | ||
# image and includes both the Python depndencies and a copy of lsst-texmf. | ||
|
||
FROM python:3.7-slim-buster AS base | ||
|
||
# Copy a file to prevent docs from being installed | ||
COPY docker/01_nodoc /etc/dpkg/dpkg.cfg.d | ||
|
||
# Update system packages | ||
COPY docker/install-base-packages.sh . | ||
RUN ./install-base-packages.sh | ||
|
||
FROM base AS dependencies | ||
|
||
# Create a Python virtual environment | ||
ENV VIRTUAL_ENV=/opt/venv | ||
RUN python -m venv $VIRTUAL_ENV | ||
# Make sure we use the virtualenv | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
# Put the latest pip and setuptools in the virtualenv | ||
RUN pip install --upgrade --quiet --no-cache-dir pip setuptools wheel | ||
# Install the Python runtime dependencies | ||
COPY requirements.txt . | ||
RUN pip install --quiet --no-cache-dir -r requirements.txt | ||
|
||
FROM base AS runtime | ||
|
||
# Create a directory for the lsst-texmf installation | ||
RUN mkdir lsst-texmf | ||
|
||
# Disable git safe directory checks, particularly for the /workspace | ||
# working directory that documents are mounted into. | ||
RUN git config --global --add safe.directory '*' | ||
|
||
# Point $TEXMFHOME to the container's lsst-texmf. This environment variable | ||
# exists for container runs by a user. | ||
ENV TEXMFHOME "/lsst-texmf/texmf" | ||
|
||
# Make sure we use the virtualenv; also add lsst-texmf's scripts to the path. | ||
ENV PATH="/lsst-texmf/bin:/opt/venv/bin:$PATH" | ||
|
||
# Install Python dependencies | ||
COPY --from=dependencies /opt/venv /opt/venv | ||
|
||
# Copy lsst-texmf repo in /lsst-texmf/ | ||
COPY . /lsst-texmf | ||
|
||
CMD ["/bin/echo", "See https://lsst-texmf.lsst.io/docker.html for usage."] |
Oops, something went wrong.