Skip to content

Test using string field #295

Test using string field

Test using string field #295

Workflow file for this run

name: CI
on:
push:
branches:
- main
- release-*
pull_request: {}
workflow_dispatch: {}
env:
GO_VERSION: "1.23" # Keep in sync with the go-version input in publish-provider-package job
jobs:
detect-noop:
runs-on: ubuntu-latest
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
with:
paths_ignore: '["**.md", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
report-breaking-changes:
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Get modified CRDs
id: modified-crds
uses: tj-actions/changed-files@039afcd1024c210363c9d3fc8fd07e1f3fcf2867 # v35.9.3 (breaks the 'Report native schema version changes' step on newer versions)
with:
files: |
package/crds/**
- name: Report breaking CRD OpenAPI v3 schema changes
if: steps.modified-crds.outputs.any_changed == 'true'
env:
MODIFIED_CRD_LIST: ${{ steps.modified-crds.outputs.all_changed_files }}
run: |
make crddiff
- name: Report native schema version changes
run: |
make schema-version-diff
lint:
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
# - name: Cleanup Disk
# uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
# with:
# large-packages: false
# swap-storage: false
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Find the Analysis Cache
id: analysis_cache
run: |
echo "analysis_cache=$HOME/.cache/golangci-lint" >> $GITHUB_OUTPUT && \
echo "analysis_cache_key=$(make go.lint.analysiskey)" >> $GITHUB_OUTPUT && \
echo "analysis_cache_key_int=$(make go.lint.analysiskey-interval)" >> $GITHUB_OUTPUT
- name: Cache Linter Analysis
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
id: cache-analysis
with:
path: ${{ steps.analysis_cache.outputs.analysis_cache }}
key: ${{ steps.analysis_cache.outputs.analysis_cache_key }}
restore-keys: |
${{ steps.analysis_cache.outputs.analysis_cache_key_int }}
- name: Vendor Dependencies
run: make vendor vendor.check
- name: Lint
env:
GOLANGCI_LINT_CACHE: ${{ steps.go_cache.outputs.analysis_cache }}
SKIP_LINTER_ANALYSIS: false
RUN_BUILDTAGGER: true
GOGC: "50"
run: make lint
check-diff:
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
# - name: Cleanup Disk
# uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
# with:
# large-packages: false
# swap-storage: false
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports
- name: Vendor Dependencies
run: make vendor vendor.check
- name: Check Diff
id: check-diff
run: |
mkdir _output
make check-diff
env:
# check-diff depends on the generate Make target, and we would like
# to save a skipped resource list
SKIPPED_RESOURCES_CSV: ../_output/skipped_resources.csv
- name: Show diff
if: failure() && steps.check-diff.outcome == 'failure'
run: git diff
- name: Report Statistics
run: head -1 _output/skipped_resources.csv
- name: Publish skipped resources CSV to Github
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: skipped_resources
path: _output/skipped_resources.csv
unit-tests:
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
# - name: Cleanup Disk
# uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
# with:
# large-packages: false
# swap-storage: false
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Fetch History
run: git fetch --prune --unshallow
- name: Setup Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Vendor Dependencies
run: make vendor vendor.check
- name: Run Unit Tests
run: make -j2 test
local-deploy:
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
# - name: Cleanup Disk
# uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
# with:
# large-packages: false
# swap-storage: false
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Fetch History
run: git fetch --prune --unshallow
- name: Setup Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Vendor Dependencies
run: make vendor vendor.check
- name: Deploying locally built provider package
run: make local-deploy
publish-provider-package:
uses: crossplane-contrib/provider-workflows/.github/workflows/publish-provider-non-family.yml@9a2125b3ec67a41a24913ada8212b9359f104c8c
with:
repository: provider-openstack
go-version: "1.23" # Keep in sync with env.GO_VERSION above
cleanup-disk: true
mirror-to-upbound-registry: false
secrets:
GHCR_PAT: ${{ secrets.GITHUB_TOKEN }}