Skip to content

Commit

Permalink
Add Setup Workflow (#422)
Browse files Browse the repository at this point in the history
* Add setup workflow.

* Use setup action.
  • Loading branch information
trisyoungs authored Jun 20, 2023
1 parent 04d07f2 commit 1ff9cbe
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 41 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ on:
branches:
- 'main'

env:
pythonVersion: 3.9
gudrunTag: 2022.4
modexTag: 0.1.2
hdf5tag: hdf5-1_10_7

jobs:

Lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: "./.github/workflows/setup"
- name: Lint
uses: "./.github/workflows/lint"

Expand All @@ -31,6 +27,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: "./.github/workflows/setup"
- name: "Test (${{ matrix.os }})"
uses: "./.github/workflows/test"

Expand All @@ -44,8 +42,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Code Version
uses: "./.github/workflows/get-version"
- name: Setup
uses: "./.github/workflows/setup"
- name: "Build (${{ matrix.os }})"
uses: "./.github/workflows/build"
- name: "Package (${{ matrix.os }})"
Expand All @@ -57,8 +55,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Code Version
uses: "./.github/workflows/get-version"
- name: Setup
uses: "./.github/workflows/setup"
- name: "Publish"
uses: "./.github/workflows/publish"
with:
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/get-version/action.yml

This file was deleted.

14 changes: 6 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ on:
branches:
- '*'

env:
pythonVersion: 3.9
gudrunTag: 2022.4
modexTag: 0.1.2
hdf5tag: hdf5-1_10_7

jobs:

Lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: "./.github/workflows/setup"
- name: Lint
uses: "./.github/workflows/lint"

Expand All @@ -31,6 +27,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: "./.github/workflows/setup"
- name: "Test (${{ matrix.os }})"
uses: "./.github/workflows/test"

Expand All @@ -54,8 +52,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Code Version
uses: "./.github/workflows/get-version"
- name: Setup
uses: "./.github/workflows/setup"
- name: "Build (${{ matrix.os }})"
uses: "./.github/workflows/build"
- name: "Package (${{ matrix.os }})"
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ on:
branches:
- 'release/*'

env:
pythonVersion: 3.9
gudrunTag: 2022.4
modexTag: 0.1.2
hdf5tag: hdf5-1_10_7

jobs:

Lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: "./.github/workflows/setup"
- name: Lint
uses: "./.github/workflows/lint"

Expand All @@ -31,6 +27,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: "./.github/workflows/setup"
- name: "Test (${{ matrix.os }})"
uses: "./.github/workflows/test"

Expand All @@ -44,8 +42,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Code Version
uses: "./.github/workflows/get-version"
- name: Setup
uses: "./.github/workflows/setup"
- name: "Build (${{ matrix.os }})"
uses: "./.github/workflows/build"
- name: "Package (${{ matrix.os }})"
Expand All @@ -57,8 +55,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Code Version
uses: "./.github/workflows/get-version"
- name: Setup
uses: "./.github/workflows/setup"
- name: "Publish"
uses: "./.github/workflows/publish"
with:
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Setup

inputs:
pythonVersion:
type: string
default: 3.9
gudrunTag:
type: string
default: 2022.4
modexTag:
type: string
default: 0.1.2
hdf5tag:
type: string
default: hdf5-1_10_7

runs:
using: "composite"
steps:

- name: Set Environment
shell: bash
run: |
set -ex
echo "pythonVersion=${{ inputs.pythonVersion }}" >> ${GITHUB_ENV}
echo "gudrunTag=${{ inputs.gudrunTag }}" >> ${GITHUB_ENV}
echo "modexTag=${{ inputs.modexTag }}" >> ${GITHUB_ENV}
echo "hdf5tag=${{ inputs.hdf5tag }}" >> ${GITHUB_ENV}
- name: Get GudPy Version
shell: bash
run: |
set -ex
GUDPY_VERSION=$(grep "VERSION =" gudpy.spec | sed "s/.*\"\(.*\)\"/\1/g")
echo "GudPy code version is ${GUDPY_VERSION}"
echo "gudPyVersion=${GUDPY_VERSION}" >> ${GITHUB_ENV}

0 comments on commit 1ff9cbe

Please sign in to comment.