From ebdc26bab02e3a4206499246cd7b4644a7275f7b Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Fri, 2 Aug 2024 13:53:40 +0000 Subject: [PATCH] add action to check for invalid dependencies --- .github/workflows/dependencies_matches.yaml | 85 +++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/dependencies_matches.yaml diff --git a/.github/workflows/dependencies_matches.yaml b/.github/workflows/dependencies_matches.yaml new file mode 100644 index 00000000..bad2e39a --- /dev/null +++ b/.github/workflows/dependencies_matches.yaml @@ -0,0 +1,85 @@ +name: Check if dependencies match +# Sometimes we have the libraries in two (or more) places +# at the same time, this check makes sure that we do use +# the same version of said libraries. +on: [push] +permissions: + issues: write + pull-requests: write + + +jobs: + wownero-seed: + runs-on: ubuntu-latest + container: + image: debian:bookworm + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + - name: Patch sources + run: | + git config --global --add safe.directory '*' + git config --global user.email "ci@mrcyjanek.net" + git config --global user.name "CI mrcyjanek.net" + ./apply_patches.sh monero + ./apply_patches.sh wownero + - name: obtain hashes + run: | + set -x + pushd external/wownero-seed + echo "EXTERNAL_WOWNEROSEED=$(git rev-parse HEAD)" >> $GITHUB_ENV + popd + echo "WOWNERO_WOWNEROSEED=$(cat wownero/contrib/depends/packages/wownero_seed.mk | grep _download_file | tr '=.' '\n' | head -2 | tail -1)" >> $GITHUB_ENV + - name: compare hashes + run: | + if [[ "x$WOWNERO_WOWNEROSEED" == "x" ]]; + then + echo "Unable to obtain wownero seed from wownero repo" + exit 1 + fi + if [[ ! "x$EXTERNAL_WOWNEROSEED" == "x$WOWNERO_WOWNEROSEED" ]]; + then + echo "external/wownero-seed doesn't match wownero/contrib/depends/packages/wownero_seed.mk checksum" + exit 1 + fi + polyseed: + strategy: + matrix: + coin: [monero, wownero] + runs-on: ubuntu-latest + container: + image: debian:bookworm + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + - name: Patch sources + run: | + git config --global --add safe.directory '*' + git config --global user.email "ci@mrcyjanek.net" + git config --global user.name "CI mrcyjanek.net" + ./apply_patches.sh ${{ matrix.coin }} + - name: prepare + run: | + set -x + pushd external/polyseed + echo "EXTERNAL_POLYSEED=$(git rev-parse HEAD)" >> $GITHUB_ENV + popd + pushd ${{ matrix.coin }}/contrib/depends + make download # sorry, this is the easiest way + mkdir sources/polyseed + pushd sources/polyseed + tar xzf ../polyseed*.tar.gz + popd + popd + - name: diff + run: | + OUTPUT=$(diff -ra external/polyseed ${{ matrix.coin }}/contrib/depends/sources/polyseed | grep -v .git) + if [[ ! "x$OUTPUT" == "x" ]]; + then + diff -ra external/polyseed ${{ matrix.coin }}/contrib/depends/sources/polyseed + exit 1 + fi