WIP Update CI #200
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "pulp-openapi-generator PR CI" | |
on: | |
pull_request: | |
concurrency: | |
group: ${{ github.ref_name }}-${{ github.workflow }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
working-directory: "pulp-openapi-generator" | |
jobs: | |
check-commits: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: "actions/checkout@v4" | |
with: | |
fetch-depth: 0 | |
path: "pulp-openapi-generator" | |
- uses: "actions/setup-python@v5" | |
with: | |
python-version: "3.11" | |
- name: "Install python dependencies" | |
run: | | |
pip install requests pygithub | |
- name: "Check commit message" | |
if: github.event_name == 'pull_request' | |
env: | |
PY_COLORS: "1" | |
ANSIBLE_FORCE_COLOR: "1" | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}" | |
run: | | |
.github/workflows/scripts/check_commit.sh | |
docs: | |
uses: "./.github/workflows/docs.yml" | |
test: | |
runs-on: "ubuntu-latest" | |
# run only after lint and docs finishes | |
needs: | |
- "docs" | |
strategy: | |
fail-fast: false | |
matrix: | |
env: | |
- TEST: "pulp" | |
steps: | |
- uses: "actions/checkout@v4" | |
with: | |
fetch-depth: 0 | |
path: "pulp-openapi-generator" | |
- uses: "actions/setup-python@v5" | |
with: | |
python-version: "3.11" | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "2.6" | |
- name: Install httpie | |
run: | | |
echo ::group::HTTPIE | |
sudo apt-get update -yq | |
sudo -E apt-get -yq --no-install-suggests --no-install-recommends install httpie jq | |
echo ::endgroup:: | |
echo "HTTPIE_CONFIG_DIR=$GITHUB_WORKSPACE/.ci/assets/httpie/" >> $GITHUB_ENV | |
- name: Before Install | |
run: .github/workflows/scripts/before_install.sh | |
shell: bash | |
- name: Install | |
run: .github/workflows/scripts/install.sh | |
env: | |
PY_COLORS: '1' | |
ANSIBLE_FORCE_COLOR: '1' | |
shell: bash | |
- name: Before Script | |
run: | | |
.github/workflows/scripts/before_script.sh | |
- name: Script | |
run: .github/workflows/scripts/script.sh | |
shell: bash | |
- name: After failure | |
if: failure() | |
run: | | |
echo "Need to debug? Please check: https://github.com/marketplace/actions/debugging-with-tmate" | |
http --timeout 30 --check-status --pretty format --print hb http://pulp/pulp/api/v3/status/ || true | |
docker images || true | |
docker ps -a || true | |
docker logs pulp || true | |
docker exec pulp ls -latr /etc/yum.repos.d/ || true | |
docker exec pulp cat /etc/yum.repos.d/* || true | |
ready-to-ship: | |
# This is a dummy dependent task to have a single entry for the branch protection rules. | |
runs-on: "ubuntu-latest" | |
needs: | |
- "check-commits" | |
- "test" | |
- "docs" | |
if: "always()" | |
steps: | |
- name: "Collect needed jobs results" | |
working-directory: "." | |
run: | | |
echo '${{toJson(needs)}}' | jq -r 'to_entries[]|select(.value.result!="success")|.key + ": " + .value.result' | |
echo '${{toJson(needs)}}' | jq -e 'to_entries|map(select(.value.result!="success"))|length == 0' | |
echo "CI says: Looks good!" | |
... |