Skip to content

Commit

Permalink
github: Update FreeBSD Test
Browse files Browse the repository at this point in the history
- Passing bitcoind version from matrix

- cleanup: Removed extra tabs and `-` from pypi.yml

Changelog-Fixed: Github action for FreeBSD setup
  • Loading branch information
ShahanaFarooqui committed Aug 22, 2024
1 parent 3a4dd5f commit 6983435
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 128 deletions.
69 changes: 20 additions & 49 deletions .github/workflows/bsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:
runs-on: ubuntu-latest
name: Build and test on FreeBSD
timeout-minutes: 120
strategy:
fail-fast: true
matrix:
bitcoind-version: ["27.1"]
steps:
- uses: actions/checkout@v4
- name: Test in FreeBSD
Expand All @@ -20,9 +24,9 @@ jobs:
usesh: true
prepare: |
pkg install -y \
bash \
wget \
py38-pip \
py38-sqlite3 \
python38 \
gmake \
git \
python \
Expand All @@ -36,52 +40,19 @@ jobs:
lowdown \
curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2021-08-3z1
cd /tmp/ || exit 1
wget https://bitcoincore.org/bin/bitcoin-core-27.1/bitcoin-27.1-x86_64-linux-gnu.tar.gz
tar -xf bitcoin-27.1-x86_64-linux-gnu.tar.bz2
sudo mv bitcoin-27.1/bin/* /usr/local/bin
rm -rf \
bitcoin-27.1-x86_64-linux-gnu.tar.gz \
bitcoin-27.1
run: |
PATH=/root/.local/bin:$PATH
pip install --user -U wheel pip
pip install --user -U -r requirements.txt
# Install utilities that aren't dependencies, but make
# running tests easier/feasible on CI (and pytest which
# keeps breaking the rerunfailures plugin).
pip install --user -U \
blinker \
flake8 \
mako \
pytest-sentry \
pytest-test-groups==1.0.3 \
pytest-custom-exit-code==0.3.0 \
pytest-json-report
git clone https://github.com/lightning/bolts.git ../bolts
# fatal: unsafe repository ('/Users/runner/work/lightning/lightning' is owned by someone else)
git config --global --add safe.directory `pwd`
git submodule update --init --recursive
python3.8 -m ensurepip
python3.8 -m pip install --upgrade pip
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2021-08-3z1
./configure CC="$CC" --disable-valgrind
cat config.vars
cat << EOF > pytest.ini
[pytest]
addopts=-p no:logging --color=yes --timeout=1800 --timeout-method=thread --test-group-random-seed=42 --junitxml=report.xml --json-report --json-report-file=report.json --json-report-indent=2
markers =
slow_test: marks tests as slow (deselect with '-m "not slow_test"')
EOF
# Just run a "quick" test without memory checking
gmake
# Clean up to maximize rsync's chances of succeeding
gmake clean
cd /tmp/ || exit 1
wget https://bitcoincore.org/bin/bitcoin-core-${{ matrix.bitcoind-version }}/bitcoin-${{ matrix.bitcoind-version }}-x86_64-linux-gnu.tar.gz
tar -xf bitcoin-${{ matrix.bitcoind-version }}-x86_64-linux-gnu.tar.bz2
sudo mv bitcoin-${{ matrix.bitcoind-version }}/bin/* /usr/local/bin
rm -rf bitcoin-${{ matrix.bitcoind-version }}-x86_64-linux-gnu.tar.gz bitcoin-${{ matrix.bitcoind-version }}
run: |
pwd
whoami
freebsd-version
bash --version
python3.8 --version
158 changes: 79 additions & 79 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
---
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
on:
push:
tags:
'^v[0-9]{2}\.[0-9]{2}(\.[0-9]{1,2})?$'
workflow_dispatch:
jobs:
deploy:
name: Build and publish ${{ matrix.package }} 🐍
runs-on: ubuntu-20.04
timeout-minutes: 120
strategy:
fail-fast: true
matrix:
include:
- PACKAGE: pyln-client
WORKDIR: contrib/pyln-client
- PACKAGE: pyln-testing
WORKDIR: contrib/pyln-testing
- PACKAGE: pyln-proto
WORKDIR: contrib/pyln-proto
- PACKAGE: pyln-grpc-proto
WORKDIR: contrib/pyln-grpc-proto
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Need to fetch entire history in order to locate the version tag
fetch-depth: 0

- name: Check version tag
run: >-
git describe --always --dirty=-modded --abbrev=7
- name: Setup Version
env:
WORKDIR: ${{ matrix.WORKDIR }}
run: |
echo "VERSION=$(git describe --abbrev=0).post$(git describe --abbrev=1 | awk -F "-" '{print $2}')" >> $GITHUB_ENV
- name: Install Poetry
env:
WORKDIR: ${{ matrix.WORKDIR }}
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "PATH=$HOME/.local/bin:$PATH"
- name: Publish distribution 📦 to Test PyPI
if: github.event_name == 'workflow_dispatch' && github.repository == 'ElementsProject/lightning'
env:
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TEST_PYPI_API_TOKEN }}
WORKDIR: ${{ matrix.WORKDIR }}
run: |
echo "POETRY VERSION TEST: $(poetry --version)"
echo "Pyln* VERSION: $VERSION"
cd ${{ env.WORKDIR }}
python3 -m pip config set global.timeout 150
poetry config repositories.testpypi https://test.pypi.org/legacy/
make upgrade-version NEW_VERSION=$VERSION
poetry build --no-interaction
poetry publish --repository testpypi --no-interaction --skip-existing
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'ElementsProject/lightning'
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
WORKDIR: ${{ matrix.WORKDIR }}
run: |
echo "POETRY VERSION PUBLISH: $(poetry --version)"
echo "Pyln* VERSION: $VERSION"
cd ${{ env.WORKDIR }}
export VERSION=$(git describe --abbrev=0)
make upgrade-version NEW_VERSION=$VERSION
python3 -m pip config set global.timeout 150
poetry build --no-interaction
poetry publish --no-interaction
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI

on:
push:
tags:
'^v[0-9]{2}\.[0-9]{2}(\.[0-9]{1,2})?$'
workflow_dispatch:

jobs:
deploy:
name: Build and publish ${{ matrix.package }} 🐍
runs-on: ubuntu-20.04
timeout-minutes: 120
strategy:
fail-fast: true
matrix:
include:
- PACKAGE: pyln-client
WORKDIR: contrib/pyln-client
- PACKAGE: pyln-testing
WORKDIR: contrib/pyln-testing
- PACKAGE: pyln-proto
WORKDIR: contrib/pyln-proto
- PACKAGE: pyln-grpc-proto
WORKDIR: contrib/pyln-grpc-proto
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Need to fetch entire history in order to locate the version tag
fetch-depth: 0

- name: Check version tag
run: >-
git describe --always --dirty=-modded --abbrev=7
- name: Setup Version
env:
WORKDIR: ${{ matrix.WORKDIR }}
run: |
echo "VERSION=$(git describe --abbrev=0).post$(git describe --abbrev=1 | awk -F "-" '{print $2}')" >> $GITHUB_ENV
- name: Install Poetry
env:
WORKDIR: ${{ matrix.WORKDIR }}
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "PATH=$HOME/.local/bin:$PATH"
- name: Publish distribution 📦 to Test PyPI
if: github.event_name == 'workflow_dispatch' && github.repository == 'ElementsProject/lightning'
env:
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TEST_PYPI_API_TOKEN }}
WORKDIR: ${{ matrix.WORKDIR }}
run: |
echo "POETRY VERSION TEST: $(poetry --version)"
echo "Pyln* VERSION: $VERSION"
cd ${{ env.WORKDIR }}
python3 -m pip config set global.timeout 150
poetry config repositories.testpypi https://test.pypi.org/legacy/
make upgrade-version NEW_VERSION=$VERSION
poetry build --no-interaction
poetry publish --repository testpypi --no-interaction --skip-existing
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'ElementsProject/lightning'
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
WORKDIR: ${{ matrix.WORKDIR }}
run: |
echo "POETRY VERSION PUBLISH: $(poetry --version)"
echo "Pyln* VERSION: $VERSION"
cd ${{ env.WORKDIR }}
export VERSION=$(git describe --abbrev=0)
make upgrade-version NEW_VERSION=$VERSION
python3 -m pip config set global.timeout 150
poetry build --no-interaction
poetry publish --no-interaction

0 comments on commit 6983435

Please sign in to comment.