Grow the heap if need be (#186) #599
This file contains 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: Run tests | |
on: | |
push: | |
branches: [ trunk ] | |
pull_request: | |
branches: [ trunk ] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
run_lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get deadsnakes repo | |
run: sudo add-apt-repository --yes ppa:deadsnakes/ppa | |
- name: Update local package lists | |
run: sudo apt update | |
- name: Install Python | |
run: sudo apt install --yes python3.10 | |
- run: python3.10 -m pip install --user pipx | |
- run: python3.10 -m pipx install poetry | |
- run: poetry install --with=dev | |
- run: poetry run ruff check scrapscript.py | |
- run: poetry run ruff format --check scrapscript.py | |
- run: poetry run mypy --strict scrapscript.py | |
run_unit_tests: | |
strategy: | |
matrix: | |
PYTHON: [python3.8, python3.9, python3.10, python3.11, python3.12, python3.13] | |
CC: [gcc, clang, tcc] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get deadsnakes repo | |
run: sudo add-apt-repository --yes ppa:deadsnakes/ppa | |
- name: Update local package lists | |
run: sudo apt update | |
- name: Install Python | |
run: sudo apt install --yes ${{matrix.PYTHON}} | |
- name: Install compiler | |
run: sudo apt install --yes ${{matrix.CC}} | |
- name: Run interpreter tests | |
run: ${{matrix.PYTHON}} scrapscript.py test | |
- name: Run compiler tests | |
run: CC=${{matrix.CC}} ${{matrix.PYTHON}} compiler_tests.py | |
- name: Run compiler tests with static heap | |
run: CC=${{matrix.CC}} CFLAGS="-DSTATIC_HEAP" ${{matrix.PYTHON}} compiler_tests.py | |
build_docker_image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
target: main | |
deploy: | |
runs-on: ubuntu-latest | |
if: | | |
github.repository == 'tekknolagi/scrapscript' && | |
github.ref == format('refs/heads/{0}', github.event.repository.default_branch) | |
needs: [run_lint, run_unit_tests] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- run: flyctl deploy --remote-only | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |