From 0c09b9cc8174da6aaebe01afe8a3826e5331039f Mon Sep 17 00:00:00 2001 From: sohalt Date: Sat, 2 Mar 2024 00:10:21 +0100 Subject: [PATCH] . --- .github/workflows/ci.yml | 25 -------------------- .github/workflows/release.yml | 44 +++++++++++++++++------------------ tests/docker-compose.yml | 2 +- 3 files changed, 23 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index e877aa0..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: CI - -on: - push: - branches: - - '**' - workflow_dispatch: null - -jobs: - test: - 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: | - cd src - flake8 --version - flake8 - - name: Test with pytest - run: | - cd src/tests - pytest --version - pytest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14a2619..0ced9cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,13 +1,11 @@ on: push: - tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 workflow_dispatch: null name: Create Release jobs: - test: + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -15,40 +13,42 @@ jobs: - 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 build: - needs: test runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install dependencies - run: | - pip install build + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main + - uses: nicknovitski/nix-develop@v1 - name: Build run: | - cd src python -m build - uses: actions/upload-artifact@v4 with: name: dist - path: src/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: dist + - name: Integration tests + run: | + pytest --version + pytest release: name: Create Release runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/v') }} environment: release - needs: build + needs: [lint, test] permissions: id-token: write steps: diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 82b6136..7fb21c7 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -21,7 +21,7 @@ services: container_name: redis pretix: - build: ./../.. + build: ./.. container_name: pretix volumes: - ./pretix/etc/pretix:/etc/pretix