| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- name: CI
- on:
- push:
- branches: [main]
- pull_request:
- permissions: {}
- jobs:
- tofu:
- uses: ChiefGyk3D/git-your-ship-together/.github/workflows/tofu-ci.yml@5c1a813d8ad21adf845d221c59d17ce9406d5e53 # v1.41.0
- permissions:
- contents: read
- pull-requests: read
- id-token: write
- with:
- directories: "stacks/00-foundation stacks/10-access stacks/20-telemetry stacks/30-workloads stacks/50-edge stacks/aws/00-foundation stacks/aws/10-access modules/vpc modules/firewall modules/twingate-bootstrap modules/twingate-connector modules/edge-host modules/docker-host modules/aws/vpc modules/aws/firewall modules/aws/twingate-connector modules/spaces-bucket"
- # tofu test in each directory; every test file mocks its providers, so
- # the job needs no credential, which is all a pull request may have.
- test: true
- # opa fmt, check --strict and test over the Spacelift push policy.
- policy-directories: .spacelift/policies
- # The workflow-lint job installs pyflakes with pipx. The tofu-ci default
- # allow-list at v1.41.0 already includes pypi.org and
- # files.pythonhosted.org, so no extra endpoints are needed.
- python:
- uses: ChiefGyk3D/git-your-ship-together/.github/workflows/python-ci.yml@5c1a813d8ad21adf845d221c59d17ce9406d5e53 # v1.41.0
- permissions:
- contents: read
- pull-requests: read
- id-token: write
- with:
- python-versions: '["3.12", "3.13"]'
- install-command: pip install pytest==9.2.0 pyyaml==6.0.2
- # The cost gate first: it is a script in this repository, so it rides the
- # Python job rather than needing a job of its own. The settings page check
- # fails when docs/wiki/Settings-Reference.md is stale against
- # docs/settings.json, and the project status check fails when
- # docs/wiki/Project-Status.md does not match its committed snapshot (offline;
- # no GitHub token in CI). The repository growth check is offline too: it
- # compares the snapshot, its recorded hashes, the committed chart PNG and the
- # growth page, with no token and no plotting library. The wiki navigation check
- # fails when a page is missing from (or dead in) docs/wiki/_nav/ or when
- # Contents.md or _Sidebar.md is stale against it. The identifier check (no cloud account ids in a
- # public repository) runs last.
- test-command: bash scripts/ci_cost_gate.sh && python -I scripts/gen_settings_doc.py --check && python -I scripts/gen_project_status.py --check && python3 -I scripts/gen_repo_metrics.py --check && python -I scripts/gen_wiki_nav.py --check && python -I -m pytest tests -q && python -I scripts/identifier_check.py --root . && python -I scripts/threat_dragon_layout.py --check
- lint-install-command: pip install ruff==0.17.0
- lint-command: ruff check scripts tests
- workflow-lint: false
- docker-build: false
- security:
- uses: ChiefGyk3D/git-your-ship-together/.github/workflows/security.yml@5c1a813d8ad21adf845d221c59d17ce9406d5e53 # v1.41.0
- permissions:
- contents: read
- security-events: write
- pull-requests: write
- id-token: write
- with:
- codeql-languages: actions
- pip-audit-requirements: ""
- ci-green:
- name: CI green
- if: ${{ always() }}
- needs: [tofu, python, security]
- runs-on: ubuntu-latest
- permissions: {}
- steps:
- - name: Fail unless every needed job succeeded
- env:
- RESULTS: ${{ join(needs.*.result, ' ') }}
- run: |
- for r in $RESULTS; do
- [ "$r" = "success" ] || { echo "a needed job finished as: $r"; exit 1; }
- done
|