forked from devitocodes/devito
-
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.
- Loading branch information
1 parent
2ecf48a
commit 9ef17eb
Showing
2 changed files
with
97 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Build PETSc Docker images | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
schedule: | ||
# Run once a week | ||
- cron: "0 13 * * 1" | ||
|
||
jobs: | ||
####################################################### | ||
############## Basic gcc CPU ########################## | ||
####################################################### | ||
deploy-cpu-bases: | ||
name: "cpu-base" | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_BUILDKIT: "1" | ||
|
||
steps: | ||
- name: Checkout devito | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check event name | ||
run: echo ${{ github.event_name }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: cleanup | ||
run: docker system prune -a -f | ||
|
||
- name: GCC image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: './docker/Dockerfile.cpu' | ||
push: true | ||
target: 'gcc' | ||
build-args: 'arch=gcc' | ||
tags: 'zoeleibowitz/bases:cpu-gcc' | ||
deploy-petsc: | ||
name: "petsc" | ||
needs: deploy-cpu-bases | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_BUILDKIT: "1" | ||
steps: | ||
- name: Checkout devito | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check event name | ||
run: echo ${{ github.event_name }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build and push image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ./docker/Dockerfile.devito | ||
push: true | ||
tags: petsc-dev | ||
build-args: base=zoeleibowitz/bases:cpu-gcc | ||
|
||
- name: Remove dangling layers | ||
run: docker system prune -f | ||
|
||
- name: Run tests | ||
run: | | ||
docker run ${{ matrix.flag }} --rm -t --name testrun 'devitocodes/devito:petsc-dev' pytest ${{ matrix.test }} |
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