Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from im-open/ithd-233358-resync-code
Browse files Browse the repository at this point in the history
ITHD-233358 Resync Code from Source
  • Loading branch information
ahernandez411 authored Jan 8, 2024
2 parents c110ec2 + d6ab9f4 commit caf82b6
Show file tree
Hide file tree
Showing 105 changed files with 1,482 additions and 1,972 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: EnricoMi
github: im-open
136 changes: 136 additions & 0 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: 'Test'
author: 'im-open'
description: 'A GitHub Action that tests this action'

inputs:
os:
description: operating system, e.g. ubuntu-22.04
required: true
python-version:
description: Python version, e.g. 3.11
required: true

runs:
using: 'composite'
steps:
- name: Setup Ubuntu
if: startsWith(inputs.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install language-pack-en language-pack-de
shell: bash

- name: Setup Python
if: inputs.python-version != 'installed'
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- name: Checkout
uses: actions/checkout@v4

- name: Detect OS
id: os
env:
OS: ${{ inputs.os }}
run: |
case "$OS" in
ubuntu*)
echo "pip-cache=~/.cache/pip" >> $GITHUB_OUTPUT
;;
macos*)
echo "pip-cache=~/Library/Caches/pip" >> $GITHUB_OUTPUT
;;
windows*)
echo "pip-cache=~\\AppData\\Local\\pip\\Cache" >> $GITHUB_OUTPUT
;;
esac
echo "date=$(date +%Y%m%d 2> /dev/null || true)" >> $GITHUB_OUTPUT
shell: bash

- name: Cache PIP Packages
uses: actions/cache@v3
id: cache
with:
path: ${{ steps.os.outputs.pip-cache }}
key: ${{ inputs.os }}-pip-test-${{ inputs.python-version }}-${{ hashFiles('**/requirements.txt', '**/constraints.txt') }}-${{ steps.os.outputs.date }}
restore-keys: |
${{ inputs.os }}-pip-test-${{ inputs.python-version }}-${{ hashFiles('**/requirements.txt', '**/constraints.txt') }}-
${{ inputs.os }}-pip-test-${{ inputs.python-version }}-
${{ inputs.os }}-pip-test-
- name: Install Python dependencies
run: |
python3 -V
python3 -m pip freeze | sort
python3 -m pip cache info || true
python3 -m pip cache list || true
python3 -m pip install --upgrade --force pip wheel
python3 -m pip install --force -r python/requirements.txt
python3 -m pip install --force -r python/test/requirements.txt -c python/test/constraints.txt
python3 -m pip freeze | sort
python3 -m pip cache info || true
python3 -m pip cache list || true
shell: bash

- name: Update expectation files
id: changes
continue-on-error: true
run: |
python/test/files/update_expectations.sh
git status
if ! git diff --exit-code || [[ $(git ls-files -o --exclude-standard | wc -l) -gt 0 ]]
then
# we only upload the changed files if we can find zip
if which zip
then
(git diff --name-only && git ls-files -o --exclude-standard) | xargs -d "\n" zip changed-expectations.zip
exit 1
fi
fi
shell: bash
- name: Upload changed expectation files
if: steps.changes.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: Changed expectations
path: changed-expectations.zip
if-no-files-found: error

- name: PyTest
env:
PYTHONPATH: ..
run: |
cd python/test
python3 -m pytest --capture=tee-sys --continue-on-collection-errors --junit-xml ../../test-results/pytest.xml
shell: bash

- name: PyTest (EST)
env:
TZ: US/Eastern
LANG: "en_US.UTF-8"
PYTHONPATH: ..
run: |
cd python/test
python3 -m pytest --capture=tee-sys --continue-on-collection-errors --junit-xml ../../test-results/pytest-est.xml
shell: bash

- name: PyTest (CET)
env:
TZ: Europe/Berlin
LANG: "de_DE.UTF-8"
PYTHONPATH: ..
run: |
cd python/test
python3 -m pytest --capture=tee-sys --continue-on-collection-errors --junit-xml ../../test-results/pytest-cet.xml
shell: bash

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results (python-${{ inputs.python-version }}, ${{ inputs.os }})
path: |
test-results/*.xml
unit-test-results.json
30 changes: 26 additions & 4 deletions .github/workflows/badges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get package downloads
id: downloads
Expand All @@ -32,13 +32,24 @@ jobs:
color: blue
path: downloads.svg

- name: Create JSON
run: |
echo '{"subject": "Docker pulls", "status": "${{ steps.downloads.outputs.total_downloads }} (${{ steps.downloads.outputs.recent_downloads_per_day }}/day)", "color": "blue"}' > downloads.json
- name: Upload badge to Gist
uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d
with:
token: ${{ secrets.GIST_TOKEN }}
gistURL: https://gist.githubusercontent.com/EnricoMi/612cb538c14731f1a8fefe504f519395
gistURL: https://gist.githubusercontent.com/im-open/612cb538c14731f1a8fefe504f519395
file: downloads.svg

- name: Upload JSON to Gist
uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d
with:
token: ${{ secrets.GIST_TOKEN }}
gistURL: https://gist.githubusercontent.com/im-open/612cb538c14731f1a8fefe504f519395
file: downloads.json

workflows:
name: Dependent workflows
runs-on: ubuntu-latest
Expand All @@ -47,7 +58,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Fetch workflows
id: workflows
Expand All @@ -61,9 +72,20 @@ jobs:
color: blue
path: workflows.svg

- name: Create JSON
run: |
echo '{"subject": "GitHub Workflows", "status": "${{ steps.workflows.outputs.total_workflows }}", "color": "blue"}' > workflows.json
- name: Upload badge to Gist
uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d
with:
token: ${{ secrets.GIST_TOKEN }}
gistURL: https://gist.githubusercontent.com/EnricoMi/612cb538c14731f1a8fefe504f519395
gistURL: https://gist.githubusercontent.com/im-open/612cb538c14731f1a8fefe504f519395
file: workflows.svg

- name: Upload JSON to Gist
uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d
with:
token: ${{ secrets.GIST_TOKEN }}
gistURL: https://gist.githubusercontent.com/im-open/612cb538c14731f1a8fefe504f519395
file: workflows.json
Loading

0 comments on commit caf82b6

Please sign in to comment.