-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: SkandaBT <[email protected]>
- Loading branch information
Showing
1 changed file
with
11 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,15 +9,15 @@ on: | |
- main | ||
|
||
jobs: | ||
test: | ||
unit-test: | ||
name: Run unit tests | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
|
@@ -27,99 +27,16 @@ jobs: | |
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run tests | ||
run: npm run test:ci | ||
- name: Test with npm | ||
run: npm test -- --coverage --reporter=junit --outputFile=./test-results.xml | ||
|
||
- name: Upload test results | ||
uses: actions/upload-artifact@v2 | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
name: test-results | ||
path: ./test-results.xml | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Upload test results to Codecov | ||
if: ${{ !cancelled() }} | ||
uses: codecov/test-results-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Lint and test | ||
run: | | ||
pytest --cov app | ||
- name: Upload coverage to Codecov | ||
if: success() | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '12' | ||
|
||
- name: Setup Java JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Cache npm | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-npm- | ||
notifications: | ||
email: | ||
recipients: | ||
- [email protected] | ||
on_success: always | ||
on_failure: always | ||
|
||
- name: Setup Go environment | ||
uses: actions/[email protected] | ||
with: | ||
# The Go version to download (if necessary) and use. Supports semver spec and ranges. Could you be sure to enclose this option in single quotation marks? | ||
go-version: # optional | ||
# Path to the go.mod or go.work file. | ||
go-version-file: # optional | ||
# Set this option to true if you want the action to always check for the latest available version that satisfies the version spec | ||
check-latest: # optional | ||
# Used to pull Go distributions from go-versions. Since there's a default, the user typically does not supply this. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting. | ||
token: # optional, default is ${{ github.server_url == 'https://github.com' && github.token || '' }} | ||
# Used to specify whether caching is needed. Set to true, if you'd like to enable caching. | ||
cache: # optional, default is true | ||
# Used to specify the path to a dependency file - go.sum | ||
cache-dependency-path: # optional | ||
# Target architecture for Go to use. Examples: x86, x64. Will use system architecture by default. | ||
architecture: # optional |