Skip to content

Commit

Permalink
feat: github actions (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardocasares authored Feb 10, 2021
1 parent a032b80 commit 70efb1b
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 1
update_configs:
- package_manager: "javascript"
directory: "/"
update_schedule: "daily"
automerged_updates:
- match:
dependency_type: "development"
update_type: "all"
- match:
dependency_type: "production"
update_type: "semver:patch"
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build

on: [push]

jobs:
build:
runs-on: ubuntu-latest
name: node-${{ matrix.node }}
strategy:
matrix:
node: [14]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn --frozen-lockfile
- run: yarn build
env:
VERCEL_GIT_COMMIT_SHA: ${{ github.sha }}
NEXT_PUBLIC_GA_TRACKING_ID: "N/A"
54 changes: 54 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Integration tests

on: [deployment_status]

jobs:
build:
if: github.event.deployment_status.state == 'success'
name: node-${{ matrix.node }} ${{ matrix.browser }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [14]
browser: ["chrome", "firefox"]
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v1
- name: Testing ${{ github.event.deployment_status.target_url }}
uses: DevExpress/testcafe-action@latest
with:
args: "${{ matrix.browser }}:headless tests"
env:
CI: true
TARGET_URL: ${{ github.event.deployment_status.target_url }}
- name: Integration tests passed
if: ${{ success() }}

run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"context": "node-${{ matrix.node }} ${{ matrix.browser }} ${{ matrix.os }}",
"state": "success",
"description": "Integration tests passed",
"target_url": "'"$GITHUB_SERVER_URL"'/'"$GITHUB_REPOSITORY"'/actions/runs/'"$GITHUB_RUN_ID"'"
}'
- name: Integration tests failed
if: ${{ failure() }}
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"context": "node-${{ matrix.node }} ${{ matrix.browser }} ${{ matrix.os }}",
"state": "failure",
"description": "Integration tests failed",
"target_url": "'"$GITHUB_SERVER_URL"'/'"$GITHUB_REPOSITORY"'/actions/runs/'"$GITHUB_RUN_ID"'"
}'

1 comment on commit 70efb1b

@vercel
Copy link

@vercel vercel bot commented on 70efb1b Feb 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.