Skip to content

Commit

Permalink
rewrite logic to use lewagon/wait-on-check-action instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Taepper committed Nov 14, 2024
1 parent 9a4bb0a commit db72ff8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ on:
push:
workflow_dispatch:

permissions:
contents: read
actions: write

env:
DOCKER_DEPENDENCY_IMAGE_NAME: ghcr.io/genspectrum/lapis-silo-dependencies

Expand Down
25 changes: 14 additions & 11 deletions .github/workflows/imageAndTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: LAPIS-SILO
on:
push:

permissions:
contents: read
actions: write

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -16,20 +12,27 @@ env:
DOCKER_IMAGE_NAME: ghcr.io/genspectrum/lapis-silo

jobs:
waitForDependencyImage:
name: Wait for dependency image
runs-on: ubuntu-latest
steps:
- name: Wait
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'Build Docker Image Dependencies'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 3

dockerImageUnitTests:
name: Build Docker Image and Run Unit Tests
runs-on: ubuntu-latest
needs: waitForDependencyImage
permissions:
packages: write
steps:
- uses: actions/checkout@v4

- name: Generate dependency files hash
id: files-hash
run: |
DIR_HASH=$(echo -n ${{ hashFiles('conanfile.py', 'conanprofile.docker', '.github/workflows/ci.yml', './Dockerfile_dependencies') }})
echo "DIR_HASH=$DIR_HASH" >> $GITHUB_ENV
- name: Docker metadata
id: dockerMetadata
uses: docker/metadata-action@v5
Expand Down Expand Up @@ -60,7 +63,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=ghcr.io/genspectrum/lapis-silo-dependencies:${{ env.DIR_HASH }}
DEPENDENCY_IMAGE=${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ github.sha }}
- name: Run tests
uses: addnab/docker-run-action@v3
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: Run Linter

on:
pull_request:
workflow_run:
workflows: [ "First Workflow" ]
types:
- completed

concurrency:
group: linter-${{ github.ref }}
Expand All @@ -15,11 +11,22 @@ env:
DOCKER_DEPENDENCY_IMAGE_NAME: ghcr.io/genspectrum/lapis-silo-dependencies

jobs:
waitForDependencyImage:
name: Wait for dependency image
runs-on: ubuntu-latest
steps:
- name: Wait
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'Build Docker Image Dependencies'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 3

linter:
name: Build And Run linter
needs: linterDependencies
needs: waitForDependencyImage
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event_name == 'pull_request' }}
env:
PR_NUMBER: ${{ github.event.number }}
container:
Expand Down

0 comments on commit db72ff8

Please sign in to comment.