Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Sohalt committed Apr 15, 2024
1 parent cafd70d commit 385318f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 75 deletions.
71 changes: 54 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,62 @@
name: CI

on:
push:
branches:
- '**'
workflow_dispatch: null

name: CI

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: nicknovitski/nix-develop@v1
- name: Lint with flake8
run: |
flake8 --version
flake8
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: nicknovitski/nix-develop@v1
- name: Build
run: |
python -m build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: nicknovitski/nix-develop@v1
- uses: actions/download-artifact@v4
with:
name: dist
path: tests/dist
- name: Integration tests
run: |
cd tests
pytest
release:
name: Create Release
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
environment: release
needs: [lint, test]
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- uses: DeterminateSystems/nix-installer-action@main
- uses: nicknovitski/nix-develop@v1
- name: Lint with flake8
run: |
cd src
flake8 --version
flake8
- name: Test with pytest
run: |
cd src/tests
pytest --version
pytest
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/-publish@release/v1
58 changes: 0 additions & 58 deletions .github/workflows/release.yml

This file was deleted.

1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
packages = with pkgs;[
podman-compose
(python3.withPackages (ps: with ps; [
build
pytest
flake8
requests
Expand Down

0 comments on commit 385318f

Please sign in to comment.