-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'latest' into slurmrestd
- Loading branch information
Showing
10 changed files
with
217 additions
and
107 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
matrix: | ||
type: string | ||
required: true | ||
description: "The strategy matrix used to build images" | ||
|
||
jobs: | ||
build: | ||
name: Build Images | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJson(inputs.matrix) }} | ||
|
||
steps: | ||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
tags: ${{ matrix.image-tags }} | ||
outputs: type=docker,dest=/tmp/image.tar | ||
build-args: SLURM_VERSION=${{ matrix.slurm-version }} | ||
cache-from: type=gha,scope=build-${{ github.ref_name }}-${{ matrix.slurm-version }} | ||
cache-to: type=gha,mode=max,scope=build-${{ github.ref_name }}-${{ matrix.slurm-version }} | ||
|
||
- name: Upload image artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: slurm-${{ matrix.slurm-version }} | ||
path: /tmp/image.tar |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,52 @@ | ||
name: Test Docker Images | ||
name: Test | ||
|
||
on: | ||
workflow_call: | ||
pull_request: | ||
push: | ||
branches: [ "latest" ] | ||
inputs: | ||
matrix: | ||
type: string | ||
required: true | ||
description: "The strategy matrix used to build images" | ||
|
||
jobs: | ||
build: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Test Images | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
slurm-version: [ "20.11.9", "22.05.2", "22.05.11", "23.02.5" ] | ||
matrix: ${{ fromJson(inputs.matrix) }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build Docker image | ||
uses: docker/build-push-action@v5 | ||
- name: Fetch image artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
load: true | ||
tags: test-image | ||
build-args: SLURM_VERSION=${{ matrix.slurm-version }} | ||
name: slurm-${{ matrix.slurm-version }} | ||
path: /tmp | ||
|
||
- name: Load image | ||
run: docker load --input /tmp/image.tar | ||
|
||
- name: Test container is restartable | ||
run: | | ||
docker container create --name rerun_test_container test-image | ||
image_name="ghcr.io/pitt-crc/test-env:${{ matrix.slurm-version }}" | ||
docker container create --name rerun_test_container $image_name | ||
docker container start -i rerun_test_container | ||
docker container start -i rerun_test_container | ||
docker container rm rerun_test_container | ||
- name: Run bats tests | ||
run: docker run -i -v $(pwd)/tests:/tests test-image bats /tests | ||
|
||
- name: Run tests | ||
run: | | ||
image_name="ghcr.io/pitt-crc/test-env:${{ matrix.slurm-version }}" | ||
docker run -i -v $(pwd)/tests:/tests $image_name bats /tests | ||
# Use this job for branch protection rules | ||
report-test-status: | ||
name: Report Test Status | ||
runs-on: ubuntu-latest | ||
needs: build | ||
needs: test | ||
if: always() | ||
steps: | ||
- name: Check build status | ||
if: ${{ contains(needs.*.result, 'failure') }} | ||
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled') }} | ||
run: exit 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Matrix | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
matrix: | ||
description: "The strategy matrix used to build images" | ||
value: ${{ jobs.matrix.outputs.matrix }} | ||
|
||
jobs: | ||
matrix: | ||
name: Load Build Matrix | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
matrix: ${{ steps.load-matrix.outputs.matrix }} | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
|
||
- name: Load matrix | ||
id: load-matrix | ||
uses: zoexx/github-action-json-file-properties@release | ||
with: | ||
file_path: ".github/workflows/matrix.json" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [ "latest" ] | ||
|
||
jobs: | ||
matrix: | ||
name: Matrix | ||
uses: ./.github/workflows/Matrix.yml | ||
|
||
build: | ||
name: Build | ||
needs: [ matrix ] | ||
uses: ./.github/workflows/DockerBuild.yml | ||
with: | ||
matrix: ${{ needs.matrix.outputs.matrix }} | ||
|
||
test: | ||
name: Test | ||
needs: [ matrix, build ] | ||
uses: ./.github/workflows/DockerTest.yml | ||
with: | ||
matrix: ${{ needs.matrix.outputs.matrix }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [ "released" ] | ||
|
||
jobs: | ||
matrix: | ||
name: Matrix | ||
uses: ./.github/workflows/Matrix.yml | ||
|
||
build: | ||
name: Build | ||
needs: [ matrix ] | ||
uses: ./.github/workflows/DockerBuild.yml | ||
with: | ||
matrix: ${{ needs.matrix.outputs.matrix }} | ||
|
||
test: | ||
name: Test | ||
needs: [ matrix, build ] | ||
uses: ./.github/workflows/DockerTest.yml | ||
with: | ||
matrix: ${{ needs.matrix.outputs.matrix }} | ||
|
||
publish: | ||
name: Publish | ||
needs: [ matrix, build, test ] | ||
uses: ./.github/workflows/DockerPublish.yml | ||
with: | ||
matrix: ${{ needs.matrix.outputs.matrix }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"matrix": { | ||
"include": [ | ||
{ | ||
"slurm-version": "20.11.9", | ||
"image-tags": "ghcr.io/pitt-crc/test-env:20.11.9" | ||
}, | ||
{ | ||
"slurm-version": "22.05.2", | ||
"image-tags": "ghcr.io/pitt-crc/test-env:22.05.2" | ||
}, | ||
{ | ||
"slurm-version": "22.05.11", | ||
"image-tags": "ghcr.io/pitt-crc/test-env:22.05.11" | ||
}, | ||
{ | ||
"slurm-version": "23.02.5", | ||
"image-tags": "ghcr.io/pitt-crc/test-env:23.02.5,ghcr.io/pitt-crc/test-env:latest" | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.