3f8abdb74f
* Add /v3/nym-nodes
- returns extended node info from local DB
- endpoint caching
- add bond_info & self_described to DB nym_nodes
- update mixnode & gateway bond status on data refresh
- add `active` column to DB nym_nodes
- use only active & bonded nodes in scraping/testrun tasks
* Improve log
* PR feedback
- remove active field from nym_nodes
- delete obsolete nym_nodes
* node-status-api: cargo sqlx prepare
* Remove guardrails in CI file
* Revert "node-status-api: cargo sqlx prepare"
This reverts commit 1fcd895f0d.
* Try to ignore sqlx files
* cargo sqlx prepare
* Repair harbor tag check
* Try without checkout action
* add awk
* Update log
58 lines
2.0 KiB
YAML
58 lines
2.0 KiB
YAML
name: ci-check-ns-api-version
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "nym-node-status-api/**"
|
|
|
|
env:
|
|
WORKING_DIRECTORY: "nym-node-status-api/nym-node-status-api"
|
|
|
|
jobs:
|
|
check-if-tag-exists:
|
|
runs-on: arc-ubuntu-22.04-dind
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get version from cargo.toml
|
|
uses: mikefarah/yq@v4.45.1
|
|
id: get_version
|
|
with:
|
|
cmd: yq -oy '.package.version' ${{ env.WORKING_DIRECTORY }}/Cargo.toml
|
|
|
|
- name: Check if git tag exists
|
|
run: |
|
|
TAG=${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
|
if [[ -z "$TAG" ]]; then
|
|
echo "Tag is empty"
|
|
exit 1
|
|
fi
|
|
git ls-remote --tags origin | awk '{print $2}'
|
|
if git ls-remote --tags origin | awk '{print $2}' | grep -q "refs/tags/$TAG$" ; then
|
|
echo "Tag '$TAG' ALREADY EXISTS on the remote"
|
|
exit 1
|
|
else
|
|
echo "Tag '$TAG' does not exist on the remote"
|
|
fi
|
|
- name: Check if harbor tag exists
|
|
run: |
|
|
TAG=${{ steps.get_version.outputs.result }}
|
|
registry=https://harbor.nymte.ch
|
|
repo_name=nym/node-status-api
|
|
if [[ -z $TAG ]]; then
|
|
echo "Tag is empty"
|
|
exit 1
|
|
fi
|
|
curl -su ${{ secrets.HARBOR_ROBOT_USERNAME }}:${{ secrets.HARBOR_ROBOT_SECRET }} "$registry/v2/$repo_name/tags/list" | jq
|
|
exists=$(curl -su ${{ secrets.HARBOR_ROBOT_USERNAME }}:${{ secrets.HARBOR_ROBOT_SECRET }} "$registry/v2/$repo_name/tags/list" | jq --arg tag $TAG '.tags | contains([$tag])' )
|
|
if [[ $exists = "true" ]]; then
|
|
echo "Version '$TAG' defined in Cargo.toml ALREADY EXISTS as tag in harbor repo"
|
|
exit 1
|
|
elif [[ $exists = "false" ]]; then
|
|
echo "Version '$TAG' doesn't exist on the remote"
|
|
else
|
|
echo "Unknown output '$exists'"
|
|
exit 1
|
|
fi
|