This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
Rust codegen skeleton #547
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Test and Build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- name: APT update | |
run: sudo apt-get update | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: earthly/actions-setup@v1 | |
with: | |
version: "latest" | |
use-cache: true | |
- name: Login to Packages Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Earthly version | |
run: earthly --version | |
- name: Expand Earthly cache | |
run: earthly config global.cache_size_mb 32768 | |
- name: Run tests | |
run: earthly --strict --use-inline-cache --save-inline-cache --remote-cache=ghcr.io/${{ github.repository }}/cache:cache --push +test | |
- name: Build image | |
if: github.ref == 'refs/heads/main' | |
run: earthly --strict --use-inline-cache --save-inline-cache --remote-cache=ghcr.io/${{ github.repository }}/cache:cache --push +docker | |
- name: Build docs | |
if: github.ref == 'refs/heads/main' | |
run: earthly --strict --use-inline-cache --save-inline-cache --remote-cache=ghcr.io/${{ github.repository }}/cache:cache --push +docs | |
deploy_docs: | |
name: Deploy Documentation | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
packages: read | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: | |
- build | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Login to Packages Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull docs | |
run: | | |
id=$(docker create ghcr.io/${{ github.repository }}/docs:latest) | |
docker cp $id:/docs - | tar xf - -C . | |
# https://github.com/actions/upload-pages-artifact#file-permissions | |
- run: chmod -c -R +rX ./docs | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ./docs | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |