chore: make ci-mgmt
This commit is contained in:
61
.github/workflows/prerequisites.yml
vendored
61
.github/workflows/prerequisites.yml
vendored
@@ -20,68 +20,83 @@ on:
|
||||
value: ${{ jobs.prerequisites.outputs.version }}
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
|
||||
PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
|
||||
PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }}
|
||||
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
|
||||
PULUMI_API: https://api.pulumi-staging.io
|
||||
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
|
||||
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
|
||||
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
||||
PYPI_USERNAME: __token__
|
||||
SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }}
|
||||
SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }}
|
||||
SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }}
|
||||
PULUMI_PROVIDER_AUTOMATION_TOKEN: ${{ secrets.PULUMI_PROVIDER_AUTOMATION_TOKEN }}
|
||||
PULUMI_PULUMI_ENABLE_JOURNALING: "true"
|
||||
TF_APPEND_USER_AGENT: pulumi
|
||||
|
||||
jobs:
|
||||
prerequisites:
|
||||
name: prerequisites
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
id-token: write # For ESC secrets.
|
||||
outputs:
|
||||
version: ${{ steps.provider-version.outputs.version }}
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: pulumi/provider-version-action@f96d032a2758fdda7939e5728eff6c0d980ae894 # v1.6.0
|
||||
persist-credentials: false
|
||||
- id: esc-secrets
|
||||
name: Map environment to ESC outputs
|
||||
uses: ./.github/actions/esc-action
|
||||
- uses: pulumi/provider-version-action@3a647064cf4697c7c6352b9a1d9e554450cbe957 # v1.6.1
|
||||
id: provider-version
|
||||
with:
|
||||
major-version: 1
|
||||
set-env: 'PROVIDER_VERSION'
|
||||
- name: Cache examples generation
|
||||
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
|
||||
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
|
||||
with:
|
||||
path: |
|
||||
.pulumi/examples-cache
|
||||
key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }}
|
||||
- name: Setup tools
|
||||
uses: ./.github/actions/setup-tools
|
||||
- name: Setup mise
|
||||
uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3
|
||||
env:
|
||||
MISE_FETCH_REMOTE_VERSIONS_TIMEOUT: 30s
|
||||
with:
|
||||
tools: go, pulumictl, pulumicli, schema-tools
|
||||
version: 2025.11.6
|
||||
github_token: ${{ steps.esc-secrets.outputs.PULUMI_BOT_TOKEN }}
|
||||
# only saving the cache in the prerequisites job
|
||||
cache_save: true
|
||||
- name: Setup Go Cache
|
||||
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
|
||||
with:
|
||||
cache-dependency-path: |
|
||||
provider/*.sum
|
||||
upstream/*.sum
|
||||
sdk/go/*.sum
|
||||
sdk/*.sum
|
||||
*.sum
|
||||
- name: Prepare local workspace before restoring previously built files
|
||||
run: make prepare_local_workspace
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Generate schema
|
||||
run: make schema
|
||||
- name: Build provider binary
|
||||
run: make provider
|
||||
- name: Unit-test provider code
|
||||
run: make test_provider
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ steps.esc-secrets.outputs.CODECOV_TOKEN }}
|
||||
- if: inputs.is_pr
|
||||
name: Check Schema is Valid
|
||||
run: |
|
||||
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
|
||||
{
|
||||
echo "SCHEMA_CHANGES<<$EOF";
|
||||
schema-tools compare -r github://api.github.com/brandonkal -p incus -o "${{ inputs.default_branch }}" -n --local-path=provider/cmd/pulumi-resource-incus/schema.json;
|
||||
schema-tools compare -r github://api.github.com/kiterun -p incus -o "${{ inputs.default_branch }}" -n --local-path=provider/cmd/pulumi-resource-incus/schema.json;
|
||||
echo "$EOF";
|
||||
} >> "$GITHUB_ENV"
|
||||
- if: inputs.is_pr && inputs.is_automated == false && github.actor != 'dependabot[bot]'
|
||||
|
||||
Reference in New Issue
Block a user