this repo has no description
at trunk 117 lines 4.0 kB view raw
1name: Run tests 2 3on: 4 push: 5 branches: [ trunk ] 6 pull_request: 7 branches: [ trunk ] 8 9 10env: 11 REGISTRY: ghcr.io 12 IMAGE_NAME: ${{ github.repository }} 13 14 15jobs: 16 run_lint: 17 runs-on: ubuntu-latest 18 steps: 19 - uses: actions/checkout@v4 20 - name: Install uv 21 uses: astral-sh/setup-uv@v5 22 - name: Install Python 23 run: uv python install 3.10 24 - run: uv sync --only-dev 25 - run: uv run ruff check scrapscript.py 26 - run: uv run ruff format --check scrapscript.py 27 - run: uv run mypy --strict scrapscript.py 28 run_interpreter_unit_tests: 29 strategy: 30 matrix: 31 PYTHON: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] 32 runs-on: ubuntu-latest 33 steps: 34 - uses: actions/checkout@v4 35 - name: Install uv 36 uses: astral-sh/setup-uv@v5 37 - name: Install Python 38 run: uv python install ${{matrix.PYTHON}} 39 - name: Pin Python 40 run: uv python pin ${{matrix.PYTHON}} 41 - name: Run interpreter tests 42 run: uv run python scrapscript_tests.py 43 run_compiler_unit_tests: 44 strategy: 45 matrix: 46 PYTHON: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] 47 CC: [gcc, clang, tcc] 48 USE_STATIC_HEAP: ["-DSTATIC_HEAP", ""] 49 runs-on: ubuntu-latest 50 steps: 51 - uses: actions/checkout@v4 52 - name: Install uv 53 uses: astral-sh/setup-uv@v5 54 - name: Update local package lists 55 run: sudo apt update 56 - name: Install Python 57 run: uv python install ${{matrix.PYTHON}} 58 - name: Pin Python 59 run: uv python pin ${{matrix.PYTHON}} 60 - name: Install other deps 61 run: sudo apt install --yes ${{matrix.CC}} valgrind 62 - name: Run compiler tests 63 run: CC=${{matrix.CC}} CFLAGS="${{matrix.USE_STATIC_HEAP}}" uv run python compiler_tests.py 64 - name: Run compiler tests -DNDEBUG 65 run: CC=${{matrix.CC}} CFLAGS="${{matrix.USE_STATIC_HEAP}} -DNDEBUG" uv run python compiler_tests.py 66 - name: Run compiler tests with ASAN 67 run: CC=${{matrix.CC}} CFLAGS="-fsanitize=address ${{matrix.USE_STATIC_HEAP}}" uv run python compiler_tests.py 68 - name: Run compiler tests with UBSAN 69 run: CC=${{matrix.CC}} CFLAGS="-fsanitize=undefined ${{matrix.USE_STATIC_HEAP}}" uv run python compiler_tests.py 70 - name: Run compiler tests with Valgrind 71 run: CC=${{matrix.CC}} CFLAGS="${{matrix.USE_STATIC_HEAP}}" USE_VALGRIND=1 uv run python compiler_tests.py 72 run_unit_tests: 73 needs: [run_interpreter_unit_tests, run_compiler_unit_tests] 74 # Fake, unnecessary 75 runs-on: ubuntu-latest 76 # Fake, unnecessary 77 steps: 78 - uses: actions/checkout@v4 79 build_docker_image: 80 runs-on: ubuntu-latest 81 permissions: 82 contents: read 83 packages: write 84 steps: 85 - uses: actions/checkout@v4 86 - name: Log in to the Container registry 87 uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 88 with: 89 registry: ${{ env.REGISTRY }} 90 username: ${{ github.actor }} 91 password: ${{ secrets.GITHUB_TOKEN }} 92 - name: Extract metadata (tags, labels) for Docker 93 id: meta 94 uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 95 with: 96 images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 97 - name: Build and push Docker image 98 uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 99 with: 100 context: . 101 push: true 102 tags: ${{ steps.meta.outputs.tags }} 103 labels: ${{ steps.meta.outputs.labels }} 104 target: main 105 file: util/Dockerfile 106 deploy: 107 runs-on: ubuntu-latest 108 if: | 109 github.repository == 'tekknolagi/scrapscript' && 110 github.ref == format('refs/heads/{0}', github.event.repository.default_branch) 111 needs: [run_lint, run_unit_tests] 112 steps: 113 - uses: actions/checkout@v4 114 - uses: superfly/flyctl-actions/setup-flyctl@master 115 - run: flyctl deploy --remote-only 116 env: 117 FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}