-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* testing actions Signed-off-by: vsoch <vsoch@users.noreply.github.com>
- Loading branch information
Showing
8 changed files
with
142 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,35 @@ | ||
name: Test Spliced Action | ||
on: | ||
pull_request: [] | ||
|
||
jobs: | ||
install-spliced: | ||
runs-on: ubuntu-latest | ||
name: Install Spliced | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install Spliced | ||
uses: ./action/install | ||
|
||
generate-matrix: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
name: Generate Spliced Matrix | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install Spliced | ||
run: pip install -e . | ||
- name: Generate Matrix | ||
uses: ./action/matrix | ||
id: matrix | ||
with: | ||
yaml: ./examples/curl.yaml | ||
|
||
- name: Show result | ||
env: | ||
matrix: ${{ steps.matrix.outputs.matrix }} | ||
run: | | ||
printf "${{ env.matrix }}\n" |
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,6 @@ | ||
FROM ghcr.io/buildsi/spliced-ubuntu-20.04:latest | ||
|
||
WORKDIR /code | ||
COPY . /code | ||
RUN pip install -e . | ||
ENTRYPOINT ["spliced"] |
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,4 @@ | ||
# GitHub Actions for Spliced | ||
|
||
- [install](install): install a specific version (or branch) of spliced | ||
- [matrix](matrix): generate a matrix of builds |
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,21 @@ | ||
name: 'Spliced Install Action' | ||
description: "install spliced" | ||
inputs: | ||
branch: | ||
description: The branch of spack to use (defaults to develop) | ||
required: true | ||
default: main | ||
release: | ||
description: A spack release to use (if defined, overrides branch) | ||
required: false | ||
default: "" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install Spliced | ||
env: | ||
INPUT_BRANCH: ${{ inputs.branch }} | ||
INPUT_RELEASE: ${{ inputs.release }} | ||
run: ${{ github.action_path }}/scripts/install.sh | ||
shell: bash |
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 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Show the user all relevant variables for debugging! | ||
printf "release: ${INPUT_RELEASE}\n" | ||
printf "branch: ${INPUT_BRANCH}\n" | ||
|
||
python -m pip install --upgrade pip setuptools wheel | ||
|
||
# Case 1: no branch or release, install from pip | ||
if [ -z "${INPUT_BRANCH}" ] && [ -z "${INPUT_RELEASE}" ]; then | ||
printf "Installing latest from pypi\n" | ||
pip install spliced | ||
elif [ ! -z "${INPUT_BRANCH}" ]; then | ||
printf "Installing from branch ${INPUT_BRANCH}\n" | ||
git clone -b "${INPUT_BRANCH}" https://github.com/buildsi/spliced /opt/spliced | ||
cd /opt/spliced | ||
pip install -e . | ||
else | ||
printf "Installing from release ${INPUT_RELEASE}\n" | ||
wget https://github.com/buildsi/spliced/releases/download/v${INPUT_RELEASE}/spliced-${INPUT_RELEASE}.tar.gz | ||
tar -xzvf spliced-${INPUT_RELEASE}.tar.gz | ||
cd spliced-${INPUT_RELEASE} | ||
pip install -e . | ||
fi |
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: "Spiced Matrix Generation" | ||
description: "Generate a spliced matrix given an input YAML file" | ||
inputs: | ||
yaml: | ||
description: path to the config YAML | ||
required: true | ||
container: | ||
description: A optional container base to include in the matrix | ||
required: false | ||
|
||
outputs: | ||
matrix: | ||
description: matrix of spliced builds | ||
value: ${{ steps.matrix.outputs.matrix }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Generate matrix | ||
id: matrix | ||
env: | ||
INPUT_YAML: ${{ inputs.yaml }} | ||
INPUT_CONTAINER: ${{ inputs.container }} | ||
run: ${{ github.action_path }}/scripts/generate.sh | ||
shell: bash |
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,21 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo $PWD | ||
ls | ||
|
||
if [ ! -f "${INPUT_YAML}" ]; then | ||
printf "${INPUT_YAML} does not exist\n" | ||
exit | ||
fi | ||
|
||
COMMAND="spliced matrix ${INPUT_YAML}" | ||
|
||
if [ ! -z "${INPUT_CONTAINER}" ]; then | ||
COMMAND="${COMMAND} --container ${INPUT_CONTAINER}" | ||
fi | ||
|
||
printf "${COMMAND}\n" | ||
${COMMAND} | ||
echo $? |
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