diff --git a/.github/workflows/cla-check.yaml b/.github/workflows/cla-check.yaml deleted file mode 100644 index cdb271af..00000000 --- a/.github/workflows/cla-check.yaml +++ /dev/null @@ -1,9 +0,0 @@ -name: cla-check -on: [pull_request] - -jobs: - cla-check: - runs-on: ubuntu-latest - steps: - - name: Check if CLA signed - uses: canonical/has-signed-canonical-cla@v1 diff --git a/.github/workflows/security-scan.yaml b/.github/workflows/policy.yaml similarity index 55% rename from .github/workflows/security-scan.yaml rename to .github/workflows/policy.yaml index 35b2bed9..cec1d63b 100644 --- a/.github/workflows/security-scan.yaml +++ b/.github/workflows/policy.yaml @@ -1,15 +1,17 @@ -name: Security scan +name: Check policy on: pull_request: push: branches: - main - hotfix/* - - work/secscan # For development + - work/check-policy # For development jobs: + policy: + uses: canonical/starflow/.github/workflows/policy.yaml@main python-scans: - name: Scan Python project + name: Security scan uses: canonical/starflow/.github/workflows/scan-python.yaml@main with: packages: python-apt-dev diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml new file mode 100644 index 00000000..c9114f28 --- /dev/null +++ b/.github/workflows/qa.yaml @@ -0,0 +1,19 @@ +name: QA +on: + push: + branches: + - "main" + - "feature/*" + - "hotfix/*" + - "release/*" + - "renovate/*" + pull_request: + +jobs: + lint: + uses: canonical/starflow/.github/workflows/lint-python.yaml@main + test: + uses: canonical/starflow/.github/workflows/test-python.yaml@main + with: + fast-test-platforms: '[["jammy", "amd64"], ["noble", "arm64"], "macos-14-large"]' + slow-test-platforms: '["jammy", "macos-14-large"]' diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml deleted file mode 100644 index dabdad2a..00000000 --- a/.github/workflows/tests.yaml +++ /dev/null @@ -1,143 +0,0 @@ -name: Tests, linting, etc. -on: - push: - branches: - - "main" - - "feature/*" - - "hotfix/*" - - "release/*" - pull_request: - -jobs: - linters: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - cache: 'pip' - - name: Configure environment - run: | - echo "::group::Begin snap install" - echo "Installing snaps in the background while running apt and pip..." - sudo snap install --no-wait --classic pyright - sudo snap install --no-wait ruff shellcheck - echo "::endgroup::" - echo "::group::apt-get" - sudo apt update - sudo apt-get install -y libapt-pkg-dev - echo "::endgroup::" - echo "::group::pip install" - python -m pip install tox - echo "::endgroup::" - echo "::group::Create virtual environments for linting processes." - tox run -m lint --notest - echo "::endgroup::" - echo "::group::Wait for snap to complete" - snap watch --last=install - echo "::endgroup::" - - name: Run Linters - run: .tox/.tox/bin/tox run --skip-pkg-install --no-list-dependencies -m lint - unit-tests: - strategy: - fail-fast: false - matrix: - platform: [ubuntu-22.04] - runs-on: ${{ matrix.platform }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Python versions on ${{ matrix.platform }} - uses: actions/setup-python@v5 - with: - python-version: | - 3.10 - 3.12 - cache: 'pip' - - name: Configure environment - run: | - echo "::group::apt-get" - sudo apt update - sudo apt-get install -y libapt-pkg-dev - echo "::endgroup::" - echo "::group::pip install" - python -m pip install tox - echo "::endgroup::" - mkdir -p results - - name: Setup Tox environments - run: tox run -m unit-tests --notest - - name: Unit tests - run: .tox/.tox/bin/tox run --skip-pkg-install --no-list-dependencies --result-json results/tox-${{ matrix.platform }}.json -m unit-tests - env: - PYTEST_ADDOPTS: "--no-header -vv -rN" - - name: Upload code coverage - uses: codecov/codecov-action@v4 - with: - directory: ./results/ - files: coverage*.xml - - name: Upload test results - if: success() || failure() - uses: actions/upload-artifact@v4 - with: - name: unit-test-results-${{ matrix.platform }} - path: results/ - integration-tests: - strategy: - fail-fast: false - matrix: - platform: [ubuntu-22.04] - python: [py310, py312] - runs-on: ${{ matrix.platform }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Python versions on ${{ matrix.platform }} - uses: actions/setup-python@v5 - with: - python-version: | - 3.10 - 3.12 - cache: 'pip' - - name: Setup LXD - uses: canonical/setup-lxd@v0.1.1 - - name: Configure environment - run: | - echo "::group::Begin snap install" - echo "Installing snaps in the background while running apt and pip..." - sudo snap install --no-wait --channel=candidate fetch-service - echo "::endgroup::" - echo "::group::apt-get" - sudo apt update - sudo apt-get install -y libapt-pkg-dev - echo "::endgroup::" - echo "::group::pip install" - python -m pip install tox - echo "::endgroup::" - mkdir -p results - echo "::group::Wait for snap to complete" - snap watch --last=install - echo "::endgroup::" - - name: Setup Tox environments - run: tox run -e integration-${{ matrix.python }} --notest - - name: Integration tests - run: .tox/.tox/bin/tox run --skip-pkg-install --no-list-dependencies --result-json results/tox-${{ matrix.platform }}-${{ matrix.python }}.json -e integration-${{ matrix.python }} - env: - PYTEST_ADDOPTS: "--no-header -vv -rN" - - name: Upload code coverage - uses: codecov/codecov-action@v4 - with: - directory: ./results/ - files: coverage*.xml - - name: Upload test results - if: success() || failure() - uses: actions/upload-artifact@v4 - with: - name: integration-test-results-${{ matrix.platform }}-${{ matrix.python }} - path: results/