Skip to content

Commit

Permalink
chore: Move from TavisCI to GitHub Actions (#783)
Browse files Browse the repository at this point in the history
* format code

* Create GH Actions workflow based on previous Travis setup

* Only from master

Was just temporarily enable for other branches for testing

* Remove obsolete Travis config

* Base semantic-release action off of dom-testing-library

https://github.com/testing-library/dom-testing-library/blob/74c63b7be5c7d628e3a415396bc6f3d83a90c28e/.github/workflows/validate.yml#L57-L99

* Complete full matrix

* Remove unnecessary secrets usage from dry run

* We need secrets being set

See https://semantic-release.gitbook.io/semantic-release/usage/configuration#dryrun:
"Note: The Dry-run mode verifies the repository push permission, even though nothing will be pushed. The verification is done to help user to figure out potential configuration issues."
  • Loading branch information
eps1lon committed Jan 17, 2022
1 parent 6877a6d commit f5bfc10
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 21 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:
runs-on: ubuntu-latest

strategy:
# Otherwise how would we know if a specific React version caused the failure?
fail-fast: false
matrix:
REACT_DIST: [16, 17]

steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
- run: yarn
- run: yarn add react@${{ matrix.REACT_DIST }} react-dom@${{ matrix.REACT_DIST }}
- run: yarn --cwd www
- run: yarn test
- name: Dry release
uses: cycjimmy/semantic-release-action@v2
with:
dry_run: true
semantic_version: 17
branches: |
[
'master',
{name: 'alpha', prerelease: true}
]
env:
# These are not available on forks but we need them on actual runs to verify everything is set up.
# Otherwise we might fail in the middle of a release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

release:
needs: test
runs-on: ubuntu-latest
if: ${{ github.repository == 'reactjs/react-transition-group' &&
contains('refs/heads/master,refs/heads/alpha',
github.ref) && github.event_name == 'push' }}
steps:
- uses: styfle/[email protected]
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
- run: yarn
- name: Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
branches: |
[
'master',
{name: 'alpha', prerelease: true}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

0 comments on commit f5bfc10

Please sign in to comment.