Only reingest on mapper changes and add implementation metadata #150
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 tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- 'push-action/**' | |
permissions: | |
contents: read | |
packages: write | |
env: | |
LINTING_PY_VERSION: "3.11" # The version of Python to use for linting (typically the minimum supported) | |
# Cancel running workflows when additional changes are pushed | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up Python ${{ env.LINTING_PY_VERSION }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.LINTING_PY_VERSION }} | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
version: "0.5.x" | |
enable-cache: true | |
- name: Install latest compatible versions of immediate dependencies | |
run: uv sync --all-extras --extra-index-url https://pip.ccdc.cam.ac.uk | |
- name: Run pre-commit | |
run: uv run pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) | |
pytest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Maximise disk space | |
run: | | |
df -h | |
sudo swapoff -a | |
sudo apt clean | |
sudo apt autoremove -y | |
sudo apt autoclean -y | |
sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc | |
df -h | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" \ | |
/opt/google/chrome \ | |
/opt/microsoft/msedge \ | |
/opt/microsoft/powershell \ | |
/opt/pipx \ | |
/usr/lib/mono \ | |
/usr/local/julia* \ | |
/usr/local/lib/node_modules \ | |
/usr/local/share/chromium \ | |
/usr/local/share/powershell \ | |
/usr/share/swift | |
df -h | |
- name: Build latest changes | |
uses: docker/bake-action@v6 | |
env: | |
CSD_ACTIVATION_KEY: '${{ secrets.CSD_ACTIVATION_KEY }}' | |
with: | |
source: "." | |
targets: "csd-ingester-test" | |
push: false | |
load: true | |
set: | | |
*.output=type=docker,compression=zstd | |
- name: Clear buildx cache | |
run: | | |
df -h | |
docker system df | |
docker buildx prune --force | |
docker system df | |
df -h | |
- name: Run test container | |
env: | |
CSD_ACTIVATION_KEY: ${{ secrets.CSD_ACTIVATION_KEY }} | |
run: | | |
docker run \ | |
-e CSD_ACTIVATION_KEY \ | |
ghcr.io/datalab-industries/csd-optimade-test:latest |