Skip to content

ci: add syncronize to lint-pr-title event (#42) #67

ci: add syncronize to lint-pr-title event (#42)

ci: add syncronize to lint-pr-title event (#42) #67

Workflow file for this run

name: llp-ci
on:
push:
branches:
- main
pull_request:
release:
types: [published]
permissions:
id-token: write
contents: read
env:
AWS_DEFAULT_REGION: us-west-2
PR_NUMBER: ${{ github.event.number }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
POETRY_VERION: 1.1.13
PYTHON_VERSION_MIN: 3.8
S3_BUCKET_PYLL_ERRORS_DOCS: leaflink-pyll-json-errors-docs-prod
jobs:
quality-checks:
strategy:
matrix:
python-version: [ 3.8 ]
runs-on: [self-hosted, leaflink-dev-general-runner]
if: github.event_name == 'push' || github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.LEAFLINK_AUTOMATION_PAT }}
- uses: LeafLink/ci-tools/python-setup@main
with:
aws-role-arn: arn:aws:iam::642296112925:role/llp-gha-reader
aws-codeartifact-repo: leaflink-pypi
python-version: ${{ matrix.python-version }}
poetry-version: ${{ env.POETRY_VERSION }}
- name: Install Dependencies
run: |
poetry install -E all
- name: Lint Code
run: |
make lint
- name: Test Code
run: |
make test-ci
generate-docs:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
if: github.event_name == 'push' || github.event_name == 'release'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.LEAFLINK_AUTOMATION_PAT }}
- uses: LeafLink/ci-tools/python-setup@main
with:
aws-role-arn: arn:aws:iam::642296112925:role/llp-gha-reader
aws-codeartifact-repo: leaflink-pypi
python-version: ${{ matrix.python-version }}
poetry-version: ${{ env.POETRY_VERSION }}
purge-aws-session: true
- name: Install Dependencies
run: |
poetry install -E all
- name: Build Docs
run: |
rm -rf ./sdocs/dist || true
make docs-build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.PYLL_JSON_ERRORS_CI_ROLE_ARN }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Publish Docs
run: |
UPLOAD_PREFIX="stable"
if [[ ! -z "${{ env.RELEASE_TAG }}" ]]; then
UPLOAD_PREFIX="${{ env.RELEASE_TAG }}"
echo "Semver tag detected. Publishing docs accordingly."
fi
echo "Publishing documentation for ${UPLOAD_PREFIX}."
aws s3 cp \
./sdocs/dist/html/ \
s3://${S3_BUCKET_PYLL_ERRORS_DOCS}/json-errors/${UPLOAD_PREFIX}/ \
--recursive --acl public-read