Skip to content

Commit

Permalink
Clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gutzbenj committed Mar 3, 2023
1 parent 43e9e1e commit eaa4118
Show file tree
Hide file tree
Showing 56 changed files with 1,433 additions and 1,906 deletions.
62 changes: 29 additions & 33 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,32 @@ jobs:
runs-on: ubuntu-latest
name: Check code coverage
steps:

- name: Acquire sources
uses: actions/checkout@v3

- name: Setup Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
architecture: x64
cache: poetry

- name: Install project
run: .github/workflows/install.sh testing

- name: Run tests, with coverage
run: |
poetry run pytest --cov=wetterdienst tests/
poetry run coverage xml
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
- name: Acquire sources
uses: actions/checkout@v3

- name: Install Poetry
run: pipx install poetry

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
architecture: x64
cache: poetry

- name: Install project
run: .github/workflows/install.sh testing

- name: Run tests, with coverage
run: |
poetry run pytest --cov=wetterdienst tests/
poetry run coverage xml
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
77 changes: 38 additions & 39 deletions .github/workflows/docker-publish-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,31 @@ env:
jobs:
build_and_test:
runs-on: ubuntu-latest

steps:
-
name: Acquire sources
- name: Acquire sources
uses: actions/checkout@v3
-
name: Setup Python

- name: Install Poetry
run: pipx install poetry

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
-
name: Setup Poetry
uses: snok/install-poetry@v1
-
name: Build wheel package
python-version: "3.11"
architecture: x64
cache: poetry

- name: Build wheel package
run: poetry build --format=wheel
-
name: Upload wheel package

- name: Upload wheel package
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-wheel-${{ github.sha }}
path: dist/wetterdienst-*.whl
retention-days: 7
-
name: Run tests

- name: Run tests
run: |
if [[ -f .github/release/full.test.yml ]]; then
docker-compose --file .github/release/full.test.yml build
Expand All @@ -64,19 +64,18 @@ jobs:
needs: build_and_test
runs-on: ubuntu-latest
steps:
-
name: Acquire sources
- name: Acquire sources
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Download wheel package

- name: Download wheel package
uses: actions/download-artifact@v3
with:
name: ${{ runner.os }}-wheel-${{ github.sha }}
path: dist
-
name: Docker meta

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
Expand All @@ -89,43 +88,43 @@ jobs:
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
-
name: Inspect meta
- name: Inspect meta
run: |
echo "Tags: ${{ steps.meta.outputs.tags }}"
echo "Labels: ${{ steps.meta.outputs.labels }}"
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
-
name: Cache Docker layers

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Inspect builder
- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
-
name: Login to GHCR
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
-
name: Build and push

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
Expand All @@ -136,13 +135,13 @@ jobs:
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
-
name: Move cache

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
-
name: Display git status
- name: Display git status
run: |
set -x
git describe --tags
Expand Down
77 changes: 39 additions & 38 deletions .github/workflows/docker-publish-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,30 @@ jobs:
runs-on: ubuntu-latest

steps:
-
name: Acquire sources
- name: Acquire sources
uses: actions/checkout@v3
-
name: Setup Python

- name: Install Poetry
run: pipx install poetry

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
-
name: Setup Poetry
uses: snok/install-poetry@v1
-
name: Build wheel package
python-version: "3.11"
architecture: x64
cache: poetry

- name: Build wheel package
run: poetry build --format=wheel
-
name: Upload wheel package

- name: Upload wheel package
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-wheel-${{ github.sha }}
path: dist/wetterdienst-*.whl
retention-days: 7
-
name: Run tests

- name: Run tests
run: |
if [[ -f .github/release/standard.test.yml ]]; then
docker-compose --file .github/release/standard.test.yml build
Expand All @@ -63,20 +64,20 @@ jobs:
docker:
needs: build_and_test
runs-on: ubuntu-latest

steps:
-
name: Acquire sources
- name: Acquire sources
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Download wheel package

- name: Download wheel package
uses: actions/download-artifact@v3
with:
name: ${{ runner.os }}-wheel-${{ github.sha }}
path: dist
-
name: Docker meta

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
Expand All @@ -89,43 +90,43 @@ jobs:
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
-
name: Inspect meta
- name: Inspect meta
run: |
echo "Tags: ${{ steps.meta.outputs.tags }}"
echo "Labels: ${{ steps.meta.outputs.labels }}"
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
-
name: Cache Docker layers

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Inspect builder
- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
-
name: Login to GHCR
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
-
name: Build and push

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
Expand All @@ -136,13 +137,13 @@ jobs:
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
-
name: Move cache

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
-
name: Display git status
- name: Display git status
run: |
set -x
git describe --tags
Expand Down

0 comments on commit eaa4118

Please sign in to comment.