Skip to content

Commit

Permalink
Merge pull request #3 from hostwithquantum/add-ci
Browse files Browse the repository at this point in the history
add ci
  • Loading branch information
till authored Feb 20, 2024
2 parents ced1761 + f7d465f commit a65db3f
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 4 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ci

on: pull_request

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: asdf-vm/actions/install@v3
with:
tool_versions: |
action-validator 0.5.1
- run: asdf reshim action-validator
- run: action-validator ./action.yml
- run: action-validator ./.github/workflows/ci.yml

test:
needs: lint
runs-on: ubuntu-latest
name: test-${{ matrix.env }}
strategy:
matrix:
env:
- production
- staging
steps:
- uses: actions/checkout@v4
- uses: ./
with:
config-production: 'foo'
config-staging: 'bar'
environment: ${{ matrix.env }}

test_failure:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
continue-on-error: true
id: fail-step
with:
config-production: 'foo'
config-staging: 'bar'
environment: stage
- if: steps.fail-step.outcome == 'success'
run: exit 1
9 changes: 5 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ inputs:
environment:
required: true
description: the environment to deploy to
type: choice
default: staging
options:
- staging
- production
config-production:
required: true
description: k8s configuration for production
Expand All @@ -21,6 +17,11 @@ inputs:
runs:
using: "composite"
steps:
- shell: bash
run: |
echo "Unknown environment: ${{ inputs.environment }}"
exit 1
if: (inputs.environment != 'production' && inputs.environment != 'staging')
- uses: yokawasa/[email protected]
with:
kubectl: '1.27.5'
Expand Down

0 comments on commit a65db3f

Please sign in to comment.