Update docker tags #13
Workflow file for this run
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: Test Apptainer Build Local | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| workflow_run: | |
| workflows: ["Docker Build (Local)"] | |
| types: | |
| - completed | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| Test-Apptainer-Local-Uploads-and-Build: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | |
| env: | |
| COMPOSE_FILE: ./docker-compose.yml | |
| REGISTRY_PREFIX: docker.io/library | |
| SERVER_NAME: localhost | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true # Ensure we get the submodule info | |
| - name: Set repository name | |
| run: echo "REPO_NAME=$(basename $GITHUB_WORKSPACE)" >> $GITHUB_ENV | |
| - name: Cache test data | |
| uses: actions/cache@v4 | |
| id: test-data-cache | |
| with: | |
| path: test/test_data | |
| key: test-data-${{ hashFiles('.gitmodules') }} | |
| restore-keys: | | |
| test-data- | |
| - name: Get test data if not cached | |
| if: steps.test-data-cache.outputs.cache-hit != 'true' | |
| run: | | |
| make get-test-data | |
| - name: Setup environment | |
| run: | | |
| # copy the example.env to .env | |
| cp example.env .env | |
| # Update .env to use the hostname | |
| sed -i "s/SERVER_NAME=.*/SERVER_NAME=localhost/" .env | |
| - name: Clean Up some More Space | |
| run: bash .github/scripts/util_free_space.sh | |
| - name: Setup Apptainer | |
| run: | | |
| sudo apt update | |
| sudo apt install -y software-properties-common | |
| sudo add-apt-repository -y ppa:apptainer/ppa | |
| sudo apt update | |
| sudo apt install -y apptainer | |
| apptainer --version | |
| - name: Build Single Docker Image | |
| run: | | |
| docker build -f EverythingDockerfile -t ezbids-everything . | |
| - name: Build Apptainer Image | |
| run: | | |
| apptainer build ezbids-everything.sif docker-daemon://ezbids-everything:latest | |
| - name: Run Apptainer Image | |
| run: | | |
| apptainer instance start --fakeroot --writable-tmpfs --cleanenv --no-home ezbids-everything.sif ezbids-everything | |
| - name: Install uv | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Verify uv installation | |
| run: uv --version | |
| - name: Verify Apptainer image is running | |
| run: | | |
| apptainer instance list | grep ezbids-everything | |
| if [ $? -ne 0 ]; then | |
| echo "Apptainer image is not running" | |
| exit 1 | |
| fi | |
| - name: Run upload test | |
| run: | | |
| make test-upload | |
| - name: Verify Apptainer image is running after upload | |
| run: | | |
| apptainer instance list | grep ezbids-everything | |
| if [ $? -ne 0 ]; then | |
| echo "Apptainer image is not running" | |
| exit 1 | |
| fi | |
| - name: Push Images | |
| if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch' | |
| run: | | |
| docker login ${{ secrets.DOCKER_USERNAME }} ${{ secrets.DOCKER_PASSWORD }} | |
| make docker-push-everything | |