Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
workflows: test dev and prod
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 committed Mar 21, 2020
1 parent a620dbf commit 6c9963e
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,24 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout code
uses: actions/checkout@v2
- name: Run
id: tag
- name: Run dev
id: tag_dev
run: |
GITHUB_REF=origin/refs/tag/v1 node ./main.js && exit 1 || true
GITHUB_REF=refs/tag/v1 node ./main.js && exit 1 || true
GITHUB_REF=refs/heads/master node ./main.js && exit 1 || true
GITHUB_REF=refs/tags/v1.0.0 node ./main.js
- name: Test
GITHUB_REF= node main.js && exit 1 || true
GITHUB_REF=origin/refs/tag/v1 node main.js && exit 1 || true
GITHUB_REF=refs/tag/v1 node main.js && exit 1 || true
GITHUB_REF=refs/heads/master node main.js && exit 1 || true
GITHUB_REF=refs/tags/v1.0.0 node main.js
- name: Test dev
run: |
test "v1.0.0" = "${{steps.tag.outputs.tag}}"
test "v1.0.0" = "${{steps.tag_dev.outputs.tag}}"
- name: Run prod
id: tag_prod
if: startsWith(github.ref, 'refs/tags') == true
uses: ./
- name: Test prod
if: startsWith(github.ref, 'refs/tags') == true
run: |
test -n "${{steps.tag_prod.outputs.tag}}"

0 comments on commit 6c9963e

Please sign in to comment.