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

Moves all CI to GitHub Actions #610

Merged
merged 5 commits into from
May 17, 2024
Merged
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
139 changes: 0 additions & 139 deletions .circleci/config.yml

This file was deleted.

81 changes: 78 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ on:
push:
branches:
- master
tags:
- 'v*.*.*'
release:
types: [published]

jobs:
test:
name: "test-node-${{ matrix.node-version }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [14, 16, 18, 20]
steps:
Expand All @@ -25,7 +26,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand All @@ -47,3 +47,78 @@ jobs:
uses: test-summary/action@v2
with:
paths: ./test-reports/jest/results.xml

lint:
name: "lint"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run prettier
run: yarn lint:check

build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- run: yarn build
- run: npm link
- run: npx proxay --help
- run: |
npx proxay -m record -h https://www.google.com -t tapes/ &
# Wait until it loads.
until (curl http://localhost:3000 2>&1 | grep Google &>/dev/null)
do
echo "Waiting until server ready..."
sleep 5
done

publish:
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs:
- test
- build
- lint
env:
# Used in setup-node and publish steps
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install --frozen-lockfile

- run: yarn build

- name: Publish to npm registry
run: npm publish --provenance --access public
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ To release a new version of Proxay, follow the following two steps:

1. Visit the [releases page](https://github.com/airtasker/proxay/releases) to see what was last announced.
2. Draft a new release:
- Tag = `v[version]` (e.g. `v2.1.1`). **Do not forget the `v`, which is required to trigger the NPM publish on CircleCI.**
- Tag = `v[version]` (e.g. `v2.1.1`). **Do not forget the `v`, which is required to trigger the NPM publish in GitHub Actions.**
- Title = `Release v[version]` (e.g. `Release v2.1.1`)
3. Make sure to announce major changes since the last version in the description.
4. Once published, [check CircleCI](https://circleci.com/gh/airtasker/proxay) to ensure publication was successful.