Bump actions/upload-artifact from 4 to 6 #57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install lint tools | |
| run: python -m pip install ruff | |
| - name: Ruff lint | |
| run: ruff check . | |
| - name: Ruff format | |
| run: ruff format --check . | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install typecheck tools | |
| run: python -m pip install mypy | |
| - name: Mypy | |
| run: mypy | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install coverage tools | |
| run: python -m pip install coverage | |
| - name: Coverage | |
| run: | | |
| coverage run -m unittest discover -s tests | |
| coverage report | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
| python-version: ["3.9", "3.10", "3.11", "3.12"] | |
| exclude: | |
| - os: "macos-latest" | |
| python-version: "3.9" | |
| - os: "macos-latest" | |
| python-version: "3.10" | |
| - os: "macos-latest" | |
| python-version: "3.11" | |
| - os: "windows-latest" | |
| python-version: "3.9" | |
| - os: "windows-latest" | |
| python-version: "3.10" | |
| - os: "windows-latest" | |
| python-version: "3.11" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Run tests | |
| run: python -m unittest discover -s tests | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [test, lint, typecheck, coverage] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tooling | |
| run: python -m pip install --upgrade pip build twine | |
| - name: Build package | |
| run: python -m build | |
| - name: Check package metadata | |
| run: python -m twine check dist/* | |
| - name: Install wheel | |
| run: python -m pip install dist/*.whl | |
| - name: Smoke test CLI | |
| run: | | |
| roc --version | |
| roc run examples/hello.roc | tee /tmp/roc_hello.out | |
| grep -Fx "Hello from Roc!" /tmp/roc_hello.out | |
| quality-gate: | |
| runs-on: ubuntu-latest | |
| needs: [test, lint, typecheck, coverage, build] | |
| if: always() | |
| steps: | |
| - name: Verify release gate | |
| run: | | |
| failures=0 | |
| if [ "${{ needs.test.result }}" != "success" ]; then | |
| echo "test: ${{ needs.test.result }}" | |
| failures=1 | |
| fi | |
| if [ "${{ needs.lint.result }}" != "success" ]; then | |
| echo "lint: ${{ needs.lint.result }}" | |
| failures=1 | |
| fi | |
| if [ "${{ needs.typecheck.result }}" != "success" ]; then | |
| echo "typecheck: ${{ needs.typecheck.result }}" | |
| failures=1 | |
| fi | |
| if [ "${{ needs.coverage.result }}" != "success" ]; then | |
| echo "coverage: ${{ needs.coverage.result }}" | |
| failures=1 | |
| fi | |
| if [ "${{ needs.build.result }}" != "success" ]; then | |
| echo "build: ${{ needs.build.result }}" | |
| failures=1 | |
| fi | |
| if [ "$failures" -ne 0 ]; then | |
| echo "Quality gate failed." | |
| exit 1 | |
| fi | |
| echo "Quality gate passed." |