From 83d6690701c7106c62e630335f07d84e423b9161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20I=C3=B1igo?= Date: Mon, 5 Sep 2022 15:16:08 +0200 Subject: [PATCH 1/3] ci: new GitHub workflow to publish to pypi --- .github/workflows/pypi.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/pypi.yaml diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml new file mode 100644 index 0000000..9dd57b0 --- /dev/null +++ b/.github/workflows/pypi.yaml @@ -0,0 +1,24 @@ +name: Publish package to PyPi +on: push + +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Install pypa/build + run: pip install build --user + - name: Build a binary wheel and a source tarball + run: python -m build --sdist --wheel --outdir dist/ + + - name: Publish distribution 📦 to TEST PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ From 89e842f9ef087b464fb9fcff00be8d5ab2089abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20I=C3=B1igo?= Date: Mon, 5 Sep 2022 15:32:09 +0200 Subject: [PATCH 2/3] ci: replace circle-ci with github workflow jobs --- .circleci/config.yml | 48 ------------------------------------- .github/workflows/pypi.yaml | 24 +++++++++++++++++-- 2 files changed, 22 insertions(+), 50 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 6fedaf8..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,48 +0,0 @@ -version: 2 - -references: - defaults: &defaults - docker: - - image: python:3.7.4 - - restore-cache: &restore-cache - restore_cache: - key: py3.7-{{ checksum "setup.py" }} - - save-cache: &save-cache - save_cache: - key: py3.7-{{ checksum "setup.py" }} - paths: - - /root/.local/lib/ - -jobs: - test: - <<: *defaults - steps: - - checkout - - *restore-cache - - run: - name: Install deps and pytest - command: pip install --progress-bar off --user . pytest - - *save-cache - - run: - name: Run tests - command: python -m pytest tests/ -sv - - lint: - <<: *defaults - steps: - - checkout - - run: - name: Install flake8 - command: pip install flake8 - - run: - name: Run lints - command: flake8 airflow_dbt/ tests/ setup.py - -workflows: - version: 2 - test: - jobs: - - test - - lint diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index 9dd57b0..204235a 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -1,7 +1,27 @@ name: Publish package to PyPi -on: push - +on: [ push ] jobs: + + lint: + name: Lint + runs-on: python:3.7.4 + steps: + - uses: actions/checkout@master + - name: Install flake8 + run: pip install flake8 + - name: Run lints + run: flake8 airflow_dbt/ tests/ setup.py + + test: + name: Test + runs-on: python:3.7.4 + steps: + - uses: actions/checkout@master + - name: Install deps and pytest + run: pip install --progress-bar off --user . pytest + - name: Run tests + run: fpython -m pytest tests/ -sv + build-n-publish: name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI runs-on: ubuntu-latest From d59b0ab1bf8916459edf7c792ce57dd3e14530c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20I=C3=B1igo?= Date: Mon, 5 Sep 2022 15:44:19 +0200 Subject: [PATCH 3/3] ci: use ubuntu image to run all jobs --- .github/workflows/pypi.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index 204235a..4a3af27 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -1,12 +1,16 @@ name: Publish package to PyPi on: [ push ] jobs: - lint: name: Lint - runs-on: python:3.7.4 + runs-on: ubuntu-latest steps: - uses: actions/checkout@master + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - uses: actions/checkout@master - name: Install flake8 run: pip install flake8 - name: Run lints @@ -14,13 +18,17 @@ jobs: test: name: Test - runs-on: python:3.7.4 + runs-on: ubuntu-latest steps: - uses: actions/checkout@master + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' - name: Install deps and pytest run: pip install --progress-bar off --user . pytest - name: Run tests - run: fpython -m pytest tests/ -sv + run: pytest tests/ -sv build-n-publish: name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI @@ -28,7 +36,7 @@ jobs: steps: - uses: actions/checkout@master - name: Set up Python 3.10 - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: '3.10' - name: Install pypa/build