Skip to content

Fix: Missed closing curly brackets in build action #551

Fix: Missed closing curly brackets in build action

Fix: Missed closing curly brackets in build action #551

Workflow file for this run

---
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2024 The Linux Foundation <https://linuxfoundation.org>
name: "🔨 Actions and Workflows"
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
push:
branches: ["main", "master"]
paths: [".github/**"]
pull_request:
types: [opened, reopened, edited, synchronize]
paths: [".github/**"]
branches: ["main", "master"]
env:
DEFAULT-PYTHON: "3.11"
ARTEFACTS: "dist"
# Configures publishing to PyPI
PUBLISH: "true"
jobs:
### Test Individual Composite Actions ###
one-password-test:
name: "1Password"
uses: os-climate/osc-github-devops/.github/workflows/one-password-credentials.yaml@main
# Do NOT run until change is merged; secrets will NOT be available and workflow WILL fail
if: github.event_name != 'pull_request'
with:
VAULT_ITEM: "op://67hdehutbpddhfbgm6ffjvdsbu/Test Secure Note/notesPlain"
EXPORT: false
secrets:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.ONE_PASSWORD_DEVELOPMENT }}
test:
name: "Synthetic Tests"
runs-on: ubuntu-latest
# if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
with:
# Does not currently work: https://github.com/actions/checkout/issues/1471
fetch-tags: true
# The semantic-tag-fetch action currently contains a workaround for this behaviour
- name: "Action: repository-classify-content"
id: repository-classify-content
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/repository-content-classify@main
- name: "Extract TOX stanza"
id: tox-stanza
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/tox-parse-stanza@main
- name: "Action: python-versions-matrix"
id: python-versions-matrix
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/python-versions-matrix@main
- name: "Action: python-twine-check"
id: python-twine-check
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/python-twine-check@main
with:
path: "tests/dist"
- name: "Action: semantic-tag-validate [semantic tag]"
id: semantic-tag-validate-good
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/semantic-tag-validate@main
with:
tag: "v1.2.3"
- name: "Action: semantic-tag-validate [junk tag]"
id: semantic-tag-validate-junk
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/semantic-tag-validate@main
with:
tag: "v1.not-valid.3.garbage"
- name: "Validate: semantic-tag-validate"
shell: bash
run: |
# Check output from: semantic-tag-validate [semantic/junk]
ERRORS="false"
if [ "${{ steps.semantic-tag-validate-good.outputs.valid }}" != "true" ]; then
echo "Errors with: semantic-tag-validate v1.2.3"
ERRORS="true"
fi
if [ "${{ steps.semantic-tag-validate-junk.outputs.valid }}" != "false" ]; then
echo "Errors with: semantic-tag-production v1.not-valid.3.garbage"
ERRORS="true"
fi
if [ "$ERRORS" = "true" ]; then
echo "ERROR: check semantic tag validation action/code"; exit 1
else
echo "All tag validation tests passed, no errors found"
fi
- name: "Action: semantic-tag-fetch"
id: semantic-tag-fetch
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/semantic-tag-fetch@main
- name: "Action: semantic-tag-production [patch]"
id: semantic-tag-production-patch
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/semantic-tag-production@main
with:
tag: "v2.9.6"
type: "patch"
- name: "Action: semantic-tag-production [minor]"
id: semantic-tag-production-minor
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/semantic-tag-production@main
with:
tag: "v0.1.2"
type: "minor"
- name: "Action: semantic-tag-production [major]"
id: semantic-tag-production-major
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/semantic-tag-production@main
with:
tag: "v1.2.3"
type: "major"
- name: "Validate Incremented PROD Tags"
shell: bash
run: |
# Check output from: semantic-tag-production
ERRORS="false"
if [ "${{ steps.semantic-tag-production-patch.outputs.tag }}" != "2.9.7" ]; then
echo "Errors with: semantic-tag-production [patch]"
ERRORS="true"
fi
if [ "${{ steps.semantic-tag-production-minor.outputs.tag }}" != "0.2.0" ]; then
echo "Errors with: semantic-tag-production [minor]"
ERRORS="true"
fi
if [ "${{ steps.semantic-tag-production-major.outputs.tag }}" != "2.0.0" ]; then
echo "Errors with: semantic-tag-production [major]"
ERRORS="true"
fi
if [ "$ERRORS" = "true" ]; then
echo "ERROR: check tag manipulation action/code"; exit 1
else
echo "All tag check tests passed, no errors found"
fi
- name: "Action: semantic-tag-development [patch]"
id: semantic-tag-development-patch
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/semantic-tag-development@main
with:
tag: "v2.9.6"
type: "patch"
- name: "Action: semantic-tag-development [minor]"
id: semantic-tag-development-minor
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/semantic-tag-development@main
with:
tag: "v1.8.3"
type: "minor"
- name: "Action: semantic-tag-development [major]"
id: semantic-tag-development-major
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/semantic-tag-development@main
with:
tag: "v4.1.1"
type: "major"
- name: "Validate Incremented DEV Tags"
shell: bash
run: |
# Check output from: semantic-tag-development
ERRORS="false"
if [ "${{ steps.semantic-tag-development-patch.outputs.tag }}" != "2.9.7-dev1" ]; then
echo "Errors with: semantic-tag-development [patch]"
ERRORS="true"
fi
if [ "${{ steps.semantic-tag-development-minor.outputs.tag }}" != "1.9.0-dev1" ]; then
echo "Errors with: semantic-tag-development [minor]"
ERRORS="true"
fi
if [ "${{ steps.semantic-tag-development-major.outputs.tag }}" != "5.0.0-dev1" ]; then
echo "Errors with: semantic-tag-development [major]"
ERRORS="true"
fi
if [ "$ERRORS" = "true" ]; then
echo "ERROR: check tag manipulation action/code"; exit 1
else
echo "All tag check tests passed, no errors found"
fi
- name: "Action: url-validity-check"
id: url-validity-check
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/url-validity-check@main
with:
prefix: "https://test.pypi.org/project"
string: "/ITR"
suffix: "/"
- name: "Action: github-workflow-metadata"
id: github-workflow-metadata
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/github-workflow-metadata@main
- name: "Action: github-mandatory-labels"
id: github-mandatory-labels
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/github-mandatory-labels@main
- name: "Validate: github-mandatory-labels"
shell: bash
run: |
# Check output from: github-mandatory-labels
if [ "${{ steps.github-mandatory-labels.outputs.present }}" = "true" ]; then
echo "Labels are reported present:"
if (gh label list | grep release); then
exit 0
fi
elif [ "${{ steps.github-mandatory-labels.outputs.created }}" = "true" ]; then
echo "Labels are reported present:"
if (gh label list | grep release); then
exit 0
fi
else
echo "The expected action outputs/labels were NOT found"
gh label list
exit 1
fi
- name: "Action: github-mandatory-secrets"
uses: os-climate/osc-github-devops/.github/actions/github-mandatory-secrets@main
# Do NOT run until change is merged; secrets will NOT be available and workflow WILL fail
if: github.event_name != 'pull_request'
# continue-on-error: true
with:
# Mandatory secrets/variables to check
pypi_development: ${{ secrets.PYPI_DEVELOPMENT }}
pypi_production: ${{ secrets.PYPI_PRODUCTION }}
one_password_development: ${{ secrets.ONE_PASSWORD_DEVELOPMENT }}
- name: "Action: string-comparison [match]"
id: string-comparison-matching
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/string-comparison@main
with:
string_a: "Mary had a little lamb"
string_b: "Mary had a little lamb"
- name: "Action: string-comparison [different]"
id: string-comparison-different
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/string-comparison@main
with:
string_a: "Mary had a little lamb"
string_b: "I don't like eating lamb"
- name: "Action: string-comparison [sub-string match]"
id: string-comparison-substring
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/string-comparison@main
with:
string_a: "Mary had a little lamb"
string_b: "a little lamb"
substring_match: "true"
- name: "Action: string-comparison [sub-string match, case-insensitive]"
id: string-comparison-substring-nocase
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/string-comparison@main
with:
string_a: "Mary had a little lamb"
string_b: "A little lamb"
substring_match: "true"
case_insensitive: "true"
- name: "Report Errors: string-comparison"
# yamllint disable-line rule:line-length
if: steps.string-comparison-matching.outputs.match == 'false'
|| steps.string-comparison-different.outputs.match == 'true'
|| steps.string-comparison-substring.outputs.match == 'false'
|| steps.string-comparison-substring-nocase.outputs.match == 'false'
shell: bash
run: |
# Check string-comparison action logic
echo "String comparison/action logic appears to be broken"
exit 1
- name: "Test TOX stanza [specific/individual stanza]"
id: tox-stanza-test-individual
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/string-in-multiline-text@main
with:
string: "testenv:tests"
encoded_text: "${{ steps.tox-stanza.outputs.encoded_stanza }}"
substring_match: "false"
case_insensitive: "false"
- name: "Test TOX stanza [multiple matches]"
id: tox-stanza-test-multiple
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/string-in-multiline-text@main
with:
string: "testenv:"
encoded_text: "${{ steps.tox-stanza.outputs.encoded_stanza }}"
substring_match: "true"
case_insensitive: "false"
- name: "Report Errors in TOX stanza tests"
# yamllint disable-line rule:line-length
if: (steps.tox-stanza-test-individual.outputs.match == 'false' ||
steps.tox-stanza-test-individual.outputs.count != '1') ||
(steps.tox-stanza-test-multiple.outputs.match == 'false' ||
steps.tox-stanza-test-multiple.outputs.count != '5')
shell: bash
run: |
# Check string-comparison action logic
echo "Parsing of TOX stanza appears to be broken"
exit 1