diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d9048ce --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: CI + +on: + push: + branches: [ "main", "develop" ] + pull_request: + branches: [ "main", "develop" ] + +jobs: + test-python: + name: Test Python + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: "pyproject.toml" + + - name: Create config directory for tests + run: | + mkdir -p ~/.config/leggen + cp config.example.toml ~/.config/leggen/config.toml + + - name: Run Python tests + run: uv run pytest + + test-frontend: + name: Test Frontend + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./frontend + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'npm' + cache-dependency-path: frontend/package-lock.json + + - name: Install dependencies + run: npm install + + - name: Run lint + run: npm run lint + + - name: Run build + run: npm run build \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b916295..a098ee1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -133,3 +133,34 @@ jobs: push: true tags: ${{ steps.meta-frontend.outputs.tags }} labels: ${{ steps.meta-frontend.outputs.labels }} + + create-github-release: + name: Create GitHub Release + runs-on: ubuntu-latest + needs: [build, publish-to-pypi, push-docker-backend, push-docker-frontend] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install git-cliff + run: | + wget -qO- https://github.com/orhun/git-cliff/releases/latest/download/git-cliff-2.10.0-x86_64-unknown-linux-gnu.tar.gz | tar xz + sudo mv git-cliff-*/git-cliff /usr/local/bin/ + + - name: Generate release notes + id: release_notes + run: | + echo "notes<> $GITHUB_OUTPUT + git-cliff --current >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} + name: Release ${{ github.ref_name }} + body: ${{ steps.release_notes.outputs.notes }} + draft: false + prerelease: false