Skip to content

Commit

Permalink
Merge pull request #4 from satackey/running-tests-on-pull-requests
Browse files Browse the repository at this point in the history
Runnning tests on pull requests
  • Loading branch information
satackey authored Jul 28, 2020
2 parents aa39ec8 + 28f28bb commit 0d2ea21
Showing 1 changed file with 34 additions and 22 deletions.
56 changes: 34 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ on:
push:
branches:
- '**'
pull_request:
delete:

jobs:
build_and_push:
build:
runs-on: ubuntu-latest

steps:
Expand All @@ -16,18 +17,32 @@ jobs:
node-version: 12.x

- uses: actions/checkout@v2

- name: Output info
id: info
run: |
if [ '${{ github.event_name }}' = 'pull_request' ]; then
echo '::set-output name=commit_message::'
exit 0
fi
echo '::set-output name=commit_message::[auto]'
- uses: satackey/[email protected]
with:
commit-message: ${{ steps.info.outputs.commit_message }}
push-branch: '{branch}-release'

- uses: actions/upload-artifact@v2
with:
name: built
path: ./

#
# test built image caching

test_saving_built:
runs-on: ubuntu-latest
needs:
- build_and_push
needs: build

steps:
- uses: actions/checkout@v2
Expand All @@ -37,11 +52,11 @@ jobs:
id: extract
run: |
echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
- uses: actions/checkout@v2
name: Pull action
- name: Download action
uses: actions/download-artifact@v2
with:
ref: ${{ steps.extract.outputs.branch }}-release
name: built
path: action-dlc

- uses: ./action-dlc
Expand All @@ -54,8 +69,7 @@ jobs:

test_restoring_built:
runs-on: ubuntu-latest
needs:
- test_saving_built
needs: test_saving_built

steps:
- uses: actions/checkout@v2
Expand All @@ -66,10 +80,10 @@ jobs:
run: |
echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
- uses: actions/checkout@v2
name: Pull action
- name: Download action
uses: actions/download-artifact@v2
with:
ref: ${{ steps.extract.outputs.branch }}-release
name: built
path: action-dlc

- uses: ./action-dlc
Expand Down Expand Up @@ -106,19 +120,18 @@ jobs:

test_saving_pulled:
runs-on: ubuntu-latest
needs:
- build_and_push
needs: build

steps:
- name: Extract
id: extract
run: |
echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
- uses: actions/checkout@v2
name: Pull action
- name: Download action
uses: actions/download-artifact@v2
with:
ref: ${{ steps.extract.outputs.branch }}-release
name: built
path: action-dlc

- uses: ./action-dlc
Expand All @@ -131,19 +144,18 @@ jobs:

test_restoring_pulled:
runs-on: ubuntu-latest
needs:
- test_saving_pulled
needs: test_saving_pulled

steps:
- name: Extract
id: extract
run: |
echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
- uses: actions/checkout@v2
name: Pull action
- name: Download action
uses: actions/download-artifact@v2
with:
ref: ${{ steps.extract.outputs.branch }}-release
name: built
path: action-dlc

- uses: ./action-dlc
Expand Down

0 comments on commit 0d2ea21

Please sign in to comment.