Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] trying to add junit reports to actions annotations #2290

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions .github/workflows/backported-labels.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
name: 'Add backported-* labels'

on:
# allow running manually
workflow_dispatch:
push:
branches: [ 'stable-*' ]

jobs:
labels:
runs-on: ubuntu-latest
steps:
- name: 'Set $LABEL from branch name'
run: |
VERSION=`sed 's/^refs\/heads\/stable-//' <<< $GITHUB_REF`
LABEL="backported-${VERSION}"
echo "LABEL=${LABEL}" >> $GITHUB_ENV

- uses: actions/checkout@v4

- name: 'Set $PR to PR number'
run: |
git log -1 --oneline
echo PR=`git log -1 --oneline | perl -ne 'print if s/^.*?\(#(\d+)\).*\(#\d+\).*$/$1/'` >> $GITHUB_ENV

- name: "Add ${{ env.LABEL }} to #${{ env.PR }}"
if: ${{ env.PR }}
uses: actions-ecosystem/action-add-labels@v1
with:
labels: ${{ env.LABEL }}
number: ${{ env.PR }}
github_token: ${{ secrets.GITHUB_TOKEN }}
# name: 'Add backported-* labels'
#
# on:
# # allow running manually
# workflow_dispatch:
# push:
# branches: [ 'stable-*' ]
#
# jobs:
# labels:
# runs-on: ubuntu-latest
# steps:
# - name: 'Set $LABEL from branch name'
# run: |
# VERSION=`sed 's/^refs\/heads\/stable-//' <<< $GITHUB_REF`
# LABEL="backported-${VERSION}"
# echo "LABEL=${LABEL}" >> $GITHUB_ENV
#
# - uses: actions/checkout@v4
#
# - name: 'Set $PR to PR number'
# run: |
# git log -1 --oneline
# echo PR=`git log -1 --oneline | perl -ne 'print if s/^.*?\(#(\d+)\).*\(#\d+\).*$/$1/'` >> $GITHUB_ENV
#
# - name: "Add ${{ env.LABEL }} to #${{ env.PR }}"
# if: ${{ env.PR }}
# uses: actions-ecosystem/action-add-labels@v1
# with:
# labels: ${{ env.LABEL }}
# number: ${{ env.PR }}
# github_token: ${{ secrets.GITHUB_TOKEN }}
160 changes: 80 additions & 80 deletions .github/workflows/build_publish.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
---
name: "Build and publish galaxy_ng package"

on:
release:
types: [published]
tags:
- '*'
branches:
- 'stable-*'

jobs:

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4

- name: Get galaxy_ng package version
shell: bash
run: echo "galaxy_ng_version=$(python3 setup.py --version)" >> $GITHUB_ENV

- name: Validate tag and galaxy_ng version match
shell: bash
if: env.galaxy_ng_version != github.ref_name
run: |
echo "::error::Tag ${{ github.ref_name }} and galaxy_ng version ${{ env.galaxy_ng_version }} doesn't match."
exit 1

- name: Update apt
run: sudo apt -y update

- name: Install LDAP requirements
run: sudo apt-get install -y libsasl2-dev libldap2-dev libssl-dev build-essential gettext python-setuptools

- name: Upgrade pip
run: pip install pip --upgrade

- name: Install galaxy_ng editable
run: pip install -e .

# set variable for the next step, so only versions higher than 4.4 gets translated
# 4.2 and 4.3 don't support translations
- name: Check galaxy_ng version for translations
shell: bash
id: version_check
run: |
is_translatable=$(python -c 'from pkg_resources import parse_version; cmp_res = parse_version("${{ env.galaxy_ng_version }}") >= parse_version("4.4"); print(cmp_res)')
echo "is_translatable=$is_translatable" >> $GITHUB_OUTPUT

- name: Build API translations
shell: bash
run: "django-admin compilemessages"
if: steps.version_check.outputs.is_translatable == 'True'

- name: Check if UI has corresponding tag
shell: bash
run: |
status_code=$(curl -LI https://api.github.com/repos/ansible/ansible-hub-ui/releases/tags/${{ env.galaxy_ng_version }} -o /dev/null -w '%{http_code}\n' -s)
if [ $status_code == "404" ]
then
echo "::error::Corresponding tag ${{ env.galaxy_ng_version }} for ansible-hub-ui not found."
exit 1
fi

- name: Build galaxy_ng python packages
run: "python3 setup.py sdist bdist_wheel"

- name: Install twine
run: "pip install twine"

- name: Publish galaxy_ng to PyPI
run: "python3 -m twine upload dist/*"
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_RELEASE_TOKEN }}
# ---
# name: "Build and publish galaxy_ng package"
#
# on:
# release:
# types: [published]
# tags:
# - '*'
# branches:
# - 'stable-*'
#
# jobs:
#
# build:
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Set up Python
# uses: actions/setup-python@v4
#
# - name: Get galaxy_ng package version
# shell: bash
# run: echo "galaxy_ng_version=$(python3 setup.py --version)" >> $GITHUB_ENV
#
# - name: Validate tag and galaxy_ng version match
# shell: bash
# if: env.galaxy_ng_version != github.ref_name
# run: |
# echo "::error::Tag ${{ github.ref_name }} and galaxy_ng version ${{ env.galaxy_ng_version }} doesn't match."
# exit 1
#
# - name: Update apt
# run: sudo apt -y update
#
# - name: Install LDAP requirements
# run: sudo apt-get install -y libsasl2-dev libldap2-dev libssl-dev build-essential gettext python-setuptools
#
# - name: Upgrade pip
# run: pip install pip --upgrade
#
# - name: Install galaxy_ng editable
# run: pip install -e .
#
# # set variable for the next step, so only versions higher than 4.4 gets translated
# # 4.2 and 4.3 don't support translations
# - name: Check galaxy_ng version for translations
# shell: bash
# id: version_check
# run: |
# is_translatable=$(python -c 'from pkg_resources import parse_version; cmp_res = parse_version("${{ env.galaxy_ng_version }}") >= parse_version("4.4"); print(cmp_res)')
# echo "is_translatable=$is_translatable" >> $GITHUB_OUTPUT
#
# - name: Build API translations
# shell: bash
# run: "django-admin compilemessages"
# if: steps.version_check.outputs.is_translatable == 'True'
#
# - name: Check if UI has corresponding tag
# shell: bash
# run: |
# status_code=$(curl -LI https://api.github.com/repos/ansible/ansible-hub-ui/releases/tags/${{ env.galaxy_ng_version }} -o /dev/null -w '%{http_code}\n' -s)
# if [ $status_code == "404" ]
# then
# echo "::error::Corresponding tag ${{ env.galaxy_ng_version }} for ansible-hub-ui not found."
# exit 1
# fi
#
# - name: Build galaxy_ng python packages
# run: "python3 setup.py sdist bdist_wheel"
#
# - name: Install twine
# run: "pip install twine"
#
# - name: Publish galaxy_ng to PyPI
# run: "python3 -m twine upload dist/*"
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_RELEASE_TOKEN }}
Loading
Loading