Skip to content

Commit

Permalink
Added workflows (#4)
Browse files Browse the repository at this point in the history
* Added workflows

* Pin YARN lock

* Pin YARN lock

* Pin YARN lock

* Pin YARN lock

* Pin YARN lock

* Pin YARN lock

* Pin YARN lock

* Update contents of the dist directory

* Pin YARN lock

* Added readme

---------

Co-authored-by: goruha <[email protected]>
  • Loading branch information
goruha and goruha authored Aug 6, 2024
1 parent c4d46fe commit a3bdcec
Show file tree
Hide file tree
Showing 25 changed files with 30,127 additions and 1,432 deletions.
15 changes: 0 additions & 15 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

24 changes: 0 additions & 24 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

1 change: 1 addition & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends: .github
102 changes: 0 additions & 102 deletions .github/release-drafter.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
_extends: .github
26 changes: 26 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Branch
on:
pull_request:
branches:
- main
- release/**
types: [opened, synchronize, reopened]
push:
branches:
- main
- release/v*
paths-ignore:
- '.github/**'
- 'docs/**'
- 'examples/**'
- 'test/**'
- 'README.md'

permissions:
contents: write
actions: write

jobs:
github-action:
uses: cloudposse-github-actions/.github/.github/workflows/ci.yml@main
secrets: inherit
52 changes: 34 additions & 18 deletions .github/workflows/test.yml → .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
name: 'test'

name: build-and-test
on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened]
push:
paths-ignore:
- '**.md'
workflow_dispatch:
branches:
- main

jobs:
unit-tests:
check-dist:
name: "check-dist matches source"
uses: cloudposse/github-actions-workflows/.github/workflows/ci-typescript-app-check-dist.yml@main
with:
node-version: 20.x

unit-test:
name: "unit tests"
runs-on: ubuntu-latest
needs: check-dist
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: |
npm test
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --prefer-offline
- uses: cloudposse/github-action-setup-atmos@v2
with:
install-wrapper: false
- name: run unit tests
run: yarn test

test-if-closed-pr-is-found:
runs-on: ubuntu-latest
steps:
Expand All @@ -30,7 +47,6 @@ jobs:
- name: Build Action
run: |
npm run build
npm run package
- name: Run Action
uses: ./
id: pr
Expand All @@ -39,8 +55,9 @@ jobs:
sha: "44b060a85b83f5baf49f523d8a58444ccca52ead"
- name: Assert PR properties
run: |
[[ ${{ steps.pr.outputs.pr_found }} == true ]] || (echo "outputs.pr_found != true"; exit 1)
[[ ${{ steps.pr.outputs.found }} == true ]] || (echo "outputs.found != true"; exit 1)
[[ ${{ steps.pr.outputs.number }} == 5 ]] || (echo "outputs.number != 5"; exit 1)
test-if-closed-pr-is-not-found-when-filtering-closed-prs:
runs-on: ubuntu-latest
steps:
Expand All @@ -53,7 +70,6 @@ jobs:
- name: Build Action
run: |
npm run build
npm run package
- name: Run Action
uses: ./
id: pr
Expand All @@ -62,8 +78,8 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
sha: "44b060a85b83f5baf49f523d8a58444ccca52ead"
- name: Exit 1, if PR was falsely found
if: steps.pr.outputs.pr_found != 'false'
run: echo "if 'outputs.pr_found' falsely triggered"; exit 1
if: steps.pr.outputs.found != 'false'
run: echo "if 'outputs.found' falsely triggered"; exit 1
- name: Assert PR properties
run: |
[[ '${{ steps.pr.outputs.number }}' == '' ]] || (echo "PR falsely found"; exit 1)
45 changes: 0 additions & 45 deletions .github/workflows/build.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/check-dist.yml

This file was deleted.

Loading

0 comments on commit a3bdcec

Please sign in to comment.