Skip to content

Commit

Permalink
Merge pull request #786 from baagaard-usgs/ci-github-actions
Browse files Browse the repository at this point in the history
 Create CI pipeline using GitHub Actions
  • Loading branch information
baagaard-usgs authored Oct 30, 2024
2 parents 0dc41d8 + f2633d9 commit e912015
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: run-ci

concurrency:
group: ${{ github.actor }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
branches:
- main

jobs:
stage-1:
uses: ./.github/workflows/ci-stage-1.yml
stage-2:
uses: ./.github/workflows/ci-stage-2.yml
needs: [stage-1]
42 changes: 42 additions & 0 deletions .github/workflows/ci-stage-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: stage-1

on:
- workflow_call

env:
IMAGE_REGISTRY: "ghcr.io/geodynamics/pylith_installer"

jobs:

# CI tests
tests:
strategy:
matrix:
os:
- debian-stable
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Build Docker image
run: docker build -t pylith-testenv --build-arg BASE_IMAGE=$IMAGE_REGISTRY/testenv-${{ matrix.os }} --target build -f docker/pylith-testenv .

- name: Run tests
run: docker run pylith-testenv ci-config/run_tests.sh

# Build documentation
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Build Docker image
run: docker build -t pylith-docenv --build-arg BASE_IMAGE=$IMAGE_REGISTRY/testenv-ubuntu-22.04 -f docker/pylith-docenv .


34 changes: 34 additions & 0 deletions .github/workflows/ci-stage-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: stage-2

on:
- workflow_call

env:
IMAGE_REGISTRY: "ghcr.io/geodynamics/pylith_installer"

jobs:

# CI tests
tests:
strategy:
matrix:
os:
- debian-testing
- ubuntu-20.04
- ubuntu-22.04
- fedora-39
- rockylinux-8
- rockylinux-9

runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Build Docker image
run: docker build -t pylith-testenv --build-arg BASE_IMAGE=$IMAGE_REGISTRY/testenv-${{ matrix.os }} --target build -f docker/pylith-testenv .

- name: Run tests
run: docker run pylith-testenv ci-config/run_tests.sh
2 changes: 1 addition & 1 deletion docker/pylith-docenv
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENV src_dir=${TOPSRC_DIR}/pylith

COPY --chown=pylith-tester:pylith-tester . ${src_dir}
WORKDIR ${src_dir}/docs
RUN python3 -m pip install sphinx myst-parser pydata-sphinx-theme sphinxcontrib.bibtex
RUN python3 -m pip install -r requirements.txt
RUN ./build.sh

CMD /bin/bash

0 comments on commit e912015

Please sign in to comment.