Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: a #1

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/check-needs/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check needs
description: Checks required jobs to see if they all passed
inputs:
failed-dependencies:
description: pass in the following "{{ contains(needs.*.result, 'failure') }}"
required: true

runs:
using: composite
steps:
- name: Test
run: |
echo FAILED_DEPENDENCY=${{ inputs.failed-dependencies }}
[[ ${{ inputs.failed-dependencies }} = true ]] && exit 1 || echo "Test executed"
shell: bash
- run: echo "success"
shell: bash
- name : machine echo job
env : { CONTENT : "${{ toJson(job) }}" }
run : "echo $CONTENT"
shell: bash
- name : machine echo env
env : { CONTENT : "${{ toJson(env) }}" }
run : "echo $CONTENT"
shell: bash
- name : machine echo github
env : { CONTENT : "${{ toJson(github) }}" }
run : "echo $CONTENT"
shell: bash
33 changes: 30 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
name: CI

on:
pull_request: {}
pull_request:

jobs:
test-1:
name: Test 1
runs-on: ubuntu-latest
steps:
- run: echo "success 1"
- run: |
echo "success 1"
echo "github.event.pull_request.head.sha: ${{ github.event.pull_request.head.sha }}"
- uses: actions/checkout@v3



test-2:
Expand All @@ -23,15 +27,38 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: echo "fail 3"
- run: exit 1
# - run: exit 1


Test:
name: Test
if: always()
runs-on: ubuntu-latest
needs:
- test-1
- test-2
- test-3
steps:
- name: Test
run: |
echo FAILED_DEPENDENCY= $FAILED_DEPENDENCY
[[ $FAILED_DEPENDENCY = true ]] && exit 1 || echo "Test executed"
shell: bash
env:
FAILED_DEPENDENCY: ${{ contains(needs.*.result, 'failure') }}
- run: echo "success"


Test2:
name: Test 2
if: always()
runs-on: ubuntu-latest
needs:
- test-1
- test-2
- test-3
steps:
- uses: actions/checkout@v3
- uses: ./.github/check-needs
with:
failed-dependencies: ${{ contains(needs.*.result, 'failure') }}
22 changes: 22 additions & 0 deletions .github/workflows/sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Sync

on:
pull_request:
types:
- synchronize
- labeled
- unlabeled

jobs:
Test:
name: Test 1
runs-on: ubuntu-latest
steps:
- run: |
echo "success 1"
echo "github.event.pull_request.head.sha: ${{ github.event.pull_request.head.sha }}"
- uses: actions/checkout@v3
- run: |
git log -1
- run: cat Example.md
- run: echo "cheese"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# gha-test

Something
=======
test some stuff