chore(terminal): add build script for lem-terminal native helper (#2182) #5055
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: | |
| branches: ["*"] | |
| pull_request: | |
| branches: ["*"] | |
| workflow_dispatch: | |
| env: | |
| IMAGE_NAME: lem | |
| IMAGE_TAGS: latest ${{ github.sha }} | |
| IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} | |
| REGISTRY_USER: ${{ github.actor }} | |
| REGISTRY_PASSWORD: ${{ github.token }} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Lint - Check for internal symbol usage | |
| run: | | |
| if [ $(grep -r --include="*.lisp" 'lem::' | wc -l) -ne 0 ]; then | |
| echo 'using `lem::` internal symbols' | |
| echo 'https://google.github.io/styleguide/lispguide.xml?showone=Packages#Packages' | |
| exit 1 | |
| fi | |
| - name: Build test image | |
| run: docker build -f docker/Dockerfile.test -t lem-tests . | |
| - name: Run tests | |
| run: docker run --rm lem-tests | |
| push_image: | |
| name: Push Image to GHCR | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| # Build image using Buildah action | |
| - name: Build Image | |
| uses: redhat-actions/buildah-build@v2 | |
| id: build_image | |
| with: | |
| containerfiles: ./Dockerfile | |
| image: ${{ env.IMAGE_NAME }} | |
| oci: true | |
| # Push the image to GHCR (Image Registry) | |
| - name: Push To GHCR | |
| uses: redhat-actions/push-to-registry@v2 | |
| id: push | |
| with: | |
| image: ${{ steps.build_image.outputs.image }} | |
| tags: ${{ steps.build_image.outputs.tags }} | |
| registry: ${{ env.IMAGE_REGISTRY }} | |
| username: ${{ env.REGISTRY_USER }} | |
| password: ${{ env.REGISTRY_PASSWORD }} | |
| extra-args: --disable-content-trust |