Skip to content

Commit

Permalink
build: Use node 22
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng92 committed Jun 7, 2024
1 parent c1b9bed commit 93921bc
Show file tree
Hide file tree
Showing 12 changed files with 1,585 additions and 2,136 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

22 changes: 0 additions & 22 deletions .eslintrc

This file was deleted.

24 changes: 12 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
workflow_dispatch:
inputs:
releaseType:
description: 'Release type - major, minor or patch'
description: "Release type - major, minor or patch"
required: false
default: ''
default: ""
preReleaseFlavor:
description: 'Pre-Release flavor - rc, beta, or anything'
description: "Pre-Release flavor - rc, beta, or anything"
required: false
default: ''
default: ""

jobs:
create-release-draft:
Expand Down Expand Up @@ -131,8 +131,8 @@ jobs:
if: ${{ steps.prep.outputs.asset_id == '' }}
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
node-version-file: ".nvmrc"
cache: "npm"

- name: Update Release Version
if: ${{ steps.prep.outputs.asset_id == '' }}
Expand Down Expand Up @@ -207,8 +207,8 @@ jobs:
if: ${{ steps.prep.outputs.asset_id == '' }}
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
node-version-file: ".nvmrc"
cache: "npm"

- name: Update Release version
if: ${{ steps.prep.outputs.asset_id == '' }}
Expand Down Expand Up @@ -274,8 +274,8 @@ jobs:
runs-on: ubuntu-latest
needs: publish-release
env:
SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}}
SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -307,8 +307,8 @@ jobs:
runs-on: ubuntu-latest
needs: publish-release
env:
SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}}
SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:

env:
GITHUB_TOKEN: ${{ github.token }}
SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}}
SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
Expand All @@ -24,8 +24,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
node-version-file: ".nvmrc"
cache: "npm"

- uses: FedericoCarboni/setup-ffmpeg@v3
id: setup-ffmpeg
Expand Down Expand Up @@ -55,13 +55,13 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
node-version-file: ".nvmrc"
cache: "npm"

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: "3.12"

- name: Google Cloud Login
id: 'auth'
Expand Down Expand Up @@ -114,13 +114,13 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
node-version-file: ".nvmrc"
cache: "npm"

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Google Cloud Login
id: 'auth'
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Setup saucectl
uses: saucelabs/saucectl-run-action@v4
Expand All @@ -249,7 +249,7 @@ jobs:
username: ${{ secrets.SAUCE_USERNAME }}
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelName: github-testcafe-sc-check-tunnel-${{ matrix.os }}-${{ matrix.browser }}
scVersion: 4.9.1
scVersion: 4.9.2

- name: Test on Sauce
working-directory: ./tests/cloud/
Expand Down Expand Up @@ -280,7 +280,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Setup saucectl
uses: saucelabs/saucectl-run-action@v4
Expand All @@ -300,7 +300,7 @@ jobs:
username: ${{ secrets.SAUCE_USERNAME }}
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelName: github-testcafe-sc-check-tunnel-${{ matrix.os }}
scVersion: 4.9.1
scVersion: 4.9.2

- name: Test on Sauce
working-directory: ./tests/cloud/
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
v22
76 changes: 35 additions & 41 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,52 @@
# Contributing to `sauce-testcafe-runner`

**Thank you for your interest in `sauce-testcafe-runner`. Your contributions are highly welcome.**
**Thank you for your interest in `sauce-testcafe-runner`. We highly value your contributions.**

There are multiple ways of getting involved:
There are several ways to get involved:

- [Report a bug](#report-a-bug)
- [Suggest a feature](#suggest-a-feature)
- [Contribute code](#contribute-code)
- [Report a Bug](#report-a-bug)
- [Suggest a Feature](#suggest-a-feature)
- [Contribute Code](#contribute-code)

Below are a few guidelines we would like you to follow.
If you need help, please reach out to us by opening an issue.
Please follow the guidelines outlined below. If you need assistance, don't hesitate to open an issue.

## Report a bug
Reporting bugs is one of the best ways to contribute. Before creating a bug report, please check that an [issue](/issues) reporting the same problem does not already exist. If there is such an issue, you may add your information as a comment.
## Report a Bug
Reporting bugs is a valuable way to contribute. Before creating a bug report, please check if an [existing issue](/issues) already addresses the problem. If one exists, feel free to add your observations as a comment.

To report a new bug you should open an issue that summarizes the bug and set the label to "bug".
To report a new bug:
- Open an issue summarizing the bug.
- Label it as "bug."
- If you are prepared to provide a fix, that's excellent! In that case, submit a pull request as described in the [Contribute Code](#contribute-code) section.

If you want to provide a fix along with your bug report: That is great! In this case please send us a pull request as described in section [Contribute Code](#contribute-code).
## Suggest a Feature
To suggest a new feature:
- Open a [new issue](../../issues/new).
- Summarize the desired functionality and its use case.
- Label the issue as "feature."

## Suggest a feature
To request a new feature you should open an [issue](../../issues/new) and summarize the desired functionality and its use case. Set the issue label to "feature".
## Contribute Code
The following outlines our workflow for code contributions:

## Contribute code
This is an outline of what the workflow for code contributions looks like
1. Browse the list of [open issues](../../issues). Choose one to work on, or create a new one to discuss your ideas.
2. It's best to discuss your plans beforehand to ensure alignment with our project goals.
3. Fork the repository on GitHub.
4. Create a topic branch from `main`.
5. Start a new pull request, label it `work in progress`, and describe your intended contributions.
6. Commit logical and self-contained changes.
7. Ensure each commit is signed off (`git commit -s -m "your message"`), as a sign of your agreement to the Developer Certificate of Origin (DCO).
8. Push your changes to a topic branch in your fork.
9. Update the pull request with new information and completed tasks.
10. Engage with any feedback from project maintainers.
11. Once complete, remove the `work in progress` label and request a review from the maintainers.
12. Your pull request requires approval from at least two [maintainers](MAINTAINERS).

- Check the list of open [issues](../../issues). Either assign an existing issue to yourself, or
create a new one that you would like work on and discuss your ideas and use cases.
### Commit Messages
Your commit messages should clearly answer two questions: what changed and why. The subject line should focus on what changed, while the body provides the reason.

It is always best to discuss your plans beforehand, to ensure that your contribution is in line with our goals.

- Fork the repository on GitHub
- Create a topic branch from where you want to base your work. This is usually 'main'.
- Open a new pull request, label it `work in progress` and outline what you will be contributing
- Make commits of logical units.
- Make sure you sign-off on your commits `git commit -s -m "adding X to change Y"`
- Write good commit messages (see below).
- Push your changes to a topic branch in your fork of the repository.
- As you push your changes, update the pull request with new infomation and tasks as you complete them
- Project maintainers might comment on your work as you progress
- When you are done, remove the `work in progess` label and ping the maintainers for a review
- Your pull request must receive a :thumbsup: from two [maintainers](MAINTAINERS)

Thanks for your contributions!

### Commit messages
Your commit messages ideally can answer two questions: what changed and why. The subject line should feature the “what” and the body of the commit should describe the “why”.

When creating a pull request, its description should reference the corresponding issue id.

### Sign your work / Developer certificate of origin
All contributions (including pull requests) must agree to the Developer Certificate of Origin (DCO) version 1.1. This is exactly the same one created and used by the Linux kernel developers and posted on http://developercertificate.org/. This is a developer's certification that he or she has the right to submit the patch for inclusion into the project. Simply submitting a contribution implies this agreement, however, please include a "Signed-off-by" tag in every patch (this tag is a conventional way to confirm that you agree to the DCO) - you can automate this with a [Git hook](https://stackoverflow.com/questions/15015894/git-add-signed-off-by-line-using-format-signoff-not-working)
Link the pull request to the relevant issue id.

```
git commit -s -m "adding X to change Y"
```

**Have fun, and happy hacking!**
**Enjoy contributing and happy coding!**
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Sauce Testcafe Runner
======================
# Sauce TestCafe Runner

Sauce Labs test runner image for [`saucectl`](https://github.com/saucelabs/saucectl) to run [TestCafe](https://testcafe.io/) tests using [saucectl](https://docs.saucelabs.com/dev/cli/saucectl/). This repository contains the code that is being executed in Sauce Labs when running `saucectl run`.
Sauce Labs provides a test runner for [`saucectl`](https://github.com/saucelabs/saucectl) designed specifically to run [TestCafe](https://testcafe.io/) tests. This repository hosts the code executed in Sauce Labs during a `saucectl run`.

If you are interested to contribute to this project, please have a look into our [contribution guidelines](https://github.com/saucelabs/sauce-testcafe-runner/blob/main/CONTRIBUTING.md).
Interested in contributing? Check out our [contribution guidelines](https://github.com/saucelabs/sauce-testcafe-runner/blob/main/CONTRIBUTING.md) for more information on how to get involved.
55 changes: 23 additions & 32 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,36 @@
# Releasing

Releasing a new version of the runner requires a Github Action to be triggered.
Releasing a new version of the runner is facilitated through a specific GitHub Action.

## How to release
## How to Release

The workflow is named [Release New Version](../../actions/workflows/release.yml).\
It has to be manually trigger, *without* creating a tag before or a release, everything will be taken care of.
To initiate a release, trigger the [Release New Version](../../actions/workflows/release.yml) workflow manually. This process does not require the creation of a tag or a release beforehand, as these steps are automated.

A new release can be made either from `main`, or any other branch.
Releases can be made from the `main` branch or any other branch, offering flexibility in the development process.

Two settings are available:
- `Release type - major, minor or patch`
- `Pre-Release flavor - rc, beta, or anything`
### Available Settings
- **Release Type**: Choose from `major`, `minor`, or `patch`, following [SemVer](https://semver.org/) guidelines.
- **Pre-Release Flavor**: Options include `rc`, `beta`, or custom labels. Omitting this setting assumes a stable and complete release.

### Release type - major, minor or patch
#### Note:
When updating an existing pre-release, avoid specifying a new release type to maintain version continuity.

Type-in the expected value depending the changes you are releasing.\
This is intended to be respectul of [SemVer](https://semver.org/)
### Examples of Release Behavior

### Pre-Release flavor - rc, beta, or anything
The behavior of the release process varies based on the inputs provided:

To publish a pre-release, you need to define a flavor. Any release without flavor is assumed to be a stable and complete release.
| Current Version | Release Type | Pre-Release Flavor | New Version |
|-----------------|--------------|--------------------|-------------|
| 1.5.7 | major | | 2.0.0 |
| 1.5.7 | major | rc | 2.0.0-rc.0 |
| 2.0.0-rc.0 | | rc | 2.0.0-rc.1 |
| 2.0.0-rc.1 | major | | 2.0.0 |

> Nota:
> If you need to update the same flavor, you *must not* specify a release type.
#### Important:

## Examples
Ensure not to consecutively specify both a release type and a pre-release flavor more than once to prevent unintended version increments.

Expected behavior depending inputs

| Current Version | Release type value | Pre-Release flavor | New version |
| --- | --- | --- | --- |
| 1.5.7 | major | | 2.0.0 |
| 1.5.7 | major | rc | 2.0.0-rc.0 |
| 2.0.0-rc.0 | | rc | 2.0.0-rc.1 |
| 2.0.0-rc.1 | major | | 2.0.0 |


> Avoid specifying twice in a row both `release type` and `pre-release flavor`, as it will increase version.
>
> | Current Version | Release type value | Pre-Release flavor | New version |
> | --- | --- | --- | --- |
> | 1.5.7 | major | rc | 2.0.0-rc.0 |
> | 2.0.0-rc.0 | major | rc | ***3.0.0-rc.0*** |
| Current Version | Release Type | Pre-Release Flavor | Resulting Version |
|-----------------|--------------|--------------------|-------------------|
| 1.5.7 | major | rc | 2.0.0-rc.0 |
| 2.0.0-rc.0 | major | rc | ***3.0.0-rc.0*** |
37 changes: 37 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const ts = require('typescript-eslint');
const js = require('@eslint/js');
const prettier = require('eslint-config-prettier');
const jest = require('eslint-plugin-jest');

module.exports = ts.config(
js.configs.recommended,
...ts.configs.recommended,
prettier,
{
plugins: {
jest: jest,
},
},
{
ignores: ['lib/**'],
},
{
files: ['**/*.*js', '**/*.*ts'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'no-undef': 'warn',
},
},
{
languageOptions: {
globals: {
__dirname: true,
console: true,
exports: true,
module: true,
require: true,
},
},
},
);
Loading

0 comments on commit 93921bc

Please sign in to comment.