Skip to content

Commit

Permalink
ci: Use transformation of teams example as the first test.
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterGC committed Aug 10, 2024
1 parent c1239c4 commit 69a3a10
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: zs-yaml CI/CD

on:
push:
branches:
Expand All @@ -11,7 +10,7 @@ on:
- main

jobs:
build-and-deploy:
test-build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -23,8 +22,20 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Install zs-yaml in dev mode
run: |
pip install -e .
- name: Test team example transformation
run: |
cd examples/team
zs-yaml team1.yaml team1_test_out.bin
if [ $? -eq 0 ]; then
echo "Transformation successful"
else
echo "Transformation failed"
exit 1
fi
- name: Set version
id: set_version
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
Expand All @@ -34,15 +45,18 @@ jobs:
VERSION=$(python setup.py --version).dev0
fi
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "Extracted version: ${VERSION}"
sed -i "s/__version__ = .*/__version__ = '${VERSION}'/" zs_yaml/_version.py
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Check distribution
run: |
twine check dist/*
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/v')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.KE_PYPI_TOKEN }}
run: |
twine check dist/*
twine upload dist/*

0 comments on commit 69a3a10

Please sign in to comment.