Skip to content

Commit

Permalink
rename env var SHA containing the sha of the head commit to HEAD_SHA
Browse files Browse the repository at this point in the history
  • Loading branch information
Taepper committed Jan 6, 2025
1 parent 27a32ca commit f5c3363
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Determine SHA
- name: Determine HEAD_SHA
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "SHA=${{ github.sha }}" >> $GITHUB_ENV
echo "HEAD_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Generate dependency files hash
Expand All @@ -50,7 +50,7 @@ jobs:
type=ref,event=branch
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=raw,value=filehash-${{ env.DIR_HASH }}
type=raw,value=commit-${{ env.SHA }}
type=raw,value=commit-${{ env.HEAD_SHA }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
tags: |
type=ref,event=branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=commit-${{ env.SHA }}
type=raw,value=commit-${{ env.HEAD_SHA }}
- name: Build unit test image
if: env.PLATFORM_BUILD == 'true'
Expand All @@ -125,7 +125,7 @@ jobs:
cache-from: type=gha,ref=${{ github.ref_name }}-image-cache
cache-to: type=gha,mode=min,ref=${{ github.ref_name }}-image-cache
build-args: |
DEPENDENCY_IMAGE=${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ env.SHA }}
DEPENDENCY_IMAGE=${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}
- name: Run tests
if: env.PLATFORM_BUILD == 'true'
Expand All @@ -143,7 +143,7 @@ jobs:
platforms: ${{ github.ref == 'refs/heads/main' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
tags: ${{ steps.dockerMetadataImage.outputs.tags }}
build-args: |
DEPENDENCY_IMAGE=ghcr.io/genspectrum/lapis-silo-dependencies:commit-${{ env.SHA }}
DEPENDENCY_IMAGE=ghcr.io/genspectrum/lapis-silo-dependencies:commit-${{ env.HEAD_SHA }}
endToEndTests:
name: Run End To End Tests
Expand All @@ -152,12 +152,12 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Determine SHA
- name: Determine HEAD_SHA
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "SHA=${{ github.sha }}" >> $GITHUB_ENV
echo "HEAD_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -179,12 +179,12 @@ jobs:
- name: Start Docker Container and preprocess data
run: docker compose -f docker-compose-for-tests-preprocessing-from-ndjson.yml up
env:
SILO_IMAGE: ${{ env.DOCKER_IMAGE_NAME }}:commit-${{ env.SHA }}
SILO_IMAGE: ${{ env.DOCKER_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}

- name: Start Docker Container and run api
run: docker compose -f docker-compose-for-tests-api.yml up -d --wait
env:
SILO_IMAGE: ${{ env.DOCKER_IMAGE_NAME }}:commit-${{ env.SHA }}
SILO_IMAGE: ${{ env.DOCKER_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}

- name: Run Tests
run: cd endToEndTests && SILO_URL=localhost:8080 npm run test
Expand Down

0 comments on commit f5c3363

Please sign in to comment.