Skip to content

fix(deps): Use original jishaku #201

fix(deps): Use original jishaku

fix(deps): Use original jishaku #201

Workflow file for this run

name: Build and Test
on:
push:
branches:
- dev
- overhaul
tags:
- 3.*
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Get full Python version
id: full-python-version
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v4
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: |
# `timeout` is not available on macOS, so we define a custom function.
[ "$(command -v timeout)" ] || function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
# Using `timeout` is a safeguard against the Poetry command hanging for some reason.
timeout 10s poetry run pip --version || rm -rf .venv
- name: Check lock file
run: poetry lock --check
- name: Install dependencies
run: |
poetry install --with github-actions,test
- name: Run pytest
env:
POETRY_TEST_INTEGRATION_GIT_USERNAME: ${GITHUB_ACTOR}
POETRY_TEST_INTEGRATION_GIT_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: poetry run pytest -v
# --- Build
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get tag name
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ziro-bot/z3r0'
run: |
set -x
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Build and push (Nightly)
uses: docker/build-push-action@v6
if: ${{ !startsWith(github.ref, 'refs/tags/') && github.ref_name == 'dev' && github.repository == 'ziro-bot/z3r0' }}
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/ziro-bot/z3r0:nightly
- name: Build and push (Canary)
uses: docker/build-push-action@v6
if: ${{ !startsWith(github.ref, 'refs/tags/') && github.ref_name == 'overhaul' && github.repository == 'ziro-bot/z3r0' }}
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/ziro-bot/z3r0:canary
- name: Build and push (Release)
uses: docker/build-push-action@v6
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ziro-bot/z3r0'
with:
context: .
file: ./docker/Dockerfile
push: true
tags: |
ghcr.io/ziro-bot/z3r0:latest
ghcr.io/ziro-bot/z3r0:${{ env.VERSION_TAG }}