Skip to content

Move from TavisCI to GitHub Actions #772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI

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

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
REACT_DIST: [16, 17]

steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
Comment on lines +19 to +22
Copy link
Member

Choose a reason for hiding this comment

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

The current active LTS version of Node is 16, so v16 seems to be better.

https://nodejs.org/en/

Suggested change
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: 16

Copy link
Member Author

Choose a reason for hiding this comment

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

The goal of this PR was to move from Travis to GitHub actions. Travis was running on node 14. I think we should do this in a follow-up.

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 so we might as well remove them?
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/cancel-workflow-action@0.9.0
- 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 }}
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export const decorators = [
<Story />
</React.StrictMode>
),
];
];
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.