Skip to content
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

chore: switch to github actions #809

Merged
merged 4 commits into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
68 changes: 68 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: validate
on: [push, pull_request]
jobs:
main:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
Copy link
Member

Choose a reason for hiding this comment

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

Do we need windows here? May be worth trying but might drain free minutes since it doubles the number of runs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Unless I'm reading this incorrectly, there is no limit to how much time the jobs run in total, only in how long an individual job runs: https://docs.github.com/en/free-pro-team@latest/actions/reference/usage-limits-billing-and-administration

There's also a limit on concurrency, but that's probably not a concern either I think.

Copy link
Member

Choose a reason for hiding this comment

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

There's also a limit on concurrency, but that's probably not a concern either I think.

There are only 20 per account. dom-testing-library alone now uses 8 instead of 4. I'm missing some context why we need to introduce the windows run.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess I figured it was easy and "free," but I guess we can drop windows 👍

node: [10.14.2, 12, 14, 15]
runs-on: ${{ matrix.os }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: ▶️ Run validate script
run: npm run validate

- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@v1

release:
needs: main
runs-on: ubuntu-latest
if:
${{ contains('master,beta,next,alpha', github.base_ref) &&
Copy link
Member Author

Choose a reason for hiding this comment

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

This doesn't appear to work. This job should not run on this PR but it is... I'm not sure how else to skip this job for non-release branches 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not 100%, but the docs say github.base_ref is only present on pull_request events. So it might be treating it like an empty string and it is matching the contains function. Just a possible guess to try something like ${{ github.base_ref != '' && contains(... or ${{ contains(..., github.base_ref || 'not-found').

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yeah! I think I need to use ref 👍 Thanks!

github.event_name == 'push' }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup node
uses: actions/setup-node@v1
with:
node-version: 14

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: 🏗 Run build script
run: npm run build

- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 16
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'master',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.