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

fix: test script #1322

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e035f3d
fix: test script
thomasrockhu-codecov Mar 8, 2024
985c9ee
fix: put it in the top dir
thomasrockhu-codecov Mar 8, 2024
9d0826a
fix: ls
thomasrockhu-codecov Mar 8, 2024
28ccc88
fix: move to src
thomasrockhu-codecov Mar 8, 2024
60df6ae
fix: make it executable
thomasrockhu-codecov Mar 8, 2024
3f12b21
fix: ls more
thomasrockhu-codecov Mar 8, 2024
759cf34
fix: update hooks
thomasrockhu-codecov Mar 8, 2024
dd9576d
fix: oops
thomasrockhu-codecov Mar 8, 2024
e089efb
fix: test not on m1
thomasrockhu-codecov Mar 8, 2024
ae4db43
fix: try just running
thomasrockhu-codecov Mar 8, 2024
4e27f93
fix: put it outside?
thomasrockhu-codecov Mar 8, 2024
cf70ca8
fix: move to composite action
thomasrockhu-codecov Mar 9, 2024
0c3f353
fix: really do the move
thomasrockhu-codecov Mar 9, 2024
0862c08
fix: remove call
thomasrockhu-codecov Mar 9, 2024
4bc5ab2
fix: move to python
thomasrockhu-codecov Mar 9, 2024
c4b359b
fix: typo
thomasrockhu-codecov Mar 9, 2024
568941a
fix: use the right dir
thomasrockhu-codecov Mar 9, 2024
b87223d
fix: only do the os part
thomasrockhu-codecov Mar 9, 2024
20d3e67
fix: do the real thing
thomasrockhu-codecov Mar 9, 2024
87da5f8
fix: src not dist
thomasrockhu-codecov Mar 9, 2024
96f40aa
fix: try different keyring
thomasrockhu-codecov Mar 13, 2024
53e5adb
import directly
thomasrockhu-codecov Mar 13, 2024
dfd343a
fix: try using the CODECOV_OS script
thomasrockhu-codecov Mar 13, 2024
27b3ac2
fix: weird it worked before
thomasrockhu-codecov Mar 13, 2024
a6f90e8
fix: echo it
thomasrockhu-codecov Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 0 additions & 22 deletions .eslintrc.json

This file was deleted.

11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Expand Up @@ -5,16 +5,17 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest, macos-latest-xlarge]
#os: [macos-latest, windows-latest, ubuntu-latest, macos-latest-xlarge]
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install dependencies
run: npm install
- name: Lint
run: npm run lint
run: pip install -r demo/requirements.txt
- name: Run tests and collect coverage
run: npm run test
run: pytest --cov demo
- name: ls
run: ls -al dist/
- name: Upload coverage to Codecov (script)
uses: ./
with:
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -22,6 +22,7 @@ lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
.coverage

# nyc test coverage
.nyc_output
Expand Down Expand Up @@ -93,3 +94,7 @@ public/

# macOS Finder metadata
.DS_Store

# python things
*.py[oc]
__pycache__
25 changes: 23 additions & 2 deletions action.yml
Expand Up @@ -108,5 +108,26 @@ branding:
color: 'red'
icon: 'umbrella'
runs:
using: 'node20'
main: 'dist/index.js'
using: 'composite'
steps:
- name: Determine os
id: determine-os
if: ${{ inputs.os }} != ""
shell: bash
run: |
./dist/scripts/determine_os.sh

- name: Upload to Codecov
id: codecov-upload
shell: bash
run: |
echo $CODECOV_OS
gpg --import ./dist/pgp_keys.asc
curl -Os https://cli.codecov.io/latest/$CODECOV_OS/codecov
curl -Os https://cli.codecov.io/latest/$CODECOV_OS/codecov.SHA256SUM
curl -Os https://cli.codecov.io/latest/$CODECOV_OS/codecov.SHA256SUM.sig
gpg --verify codecov.SHA256SUM.sig codecov.SHA256SUM

shasum -a 256 -c codecov.SHA256SUM
sudo chmod +x codecov
./codecov
Empty file added demo/__init__.py
Empty file.
15 changes: 15 additions & 0 deletions demo/calculator.py
@@ -0,0 +1,15 @@
class Calculator:

def add(x, y):
return x + y

def subtract(x, y):
return x - y

def multiply(x, y):
return x * y

def divide(x, y):
if y == 0:
return 'Cannot divide by 0'
return x * 1.0 / y
11 changes: 0 additions & 11 deletions demo/calculator/calculator.test.ts

This file was deleted.

10 changes: 0 additions & 10 deletions demo/calculator/calculator.ts

This file was deleted.

31 changes: 31 additions & 0 deletions demo/calculator_test.py
@@ -0,0 +1,31 @@
from .calculator import Calculator


def test_add():
assert Calculator.add(1, 2) == 3.0
assert Calculator.add(1.0, 2.0) == 3.0
assert Calculator.add(0, 2.0) == 2.0
assert Calculator.add(2.0, 0) == 2.0
assert Calculator.add(-4, 2.0) == -2.0

def test_subtract():
assert Calculator.subtract(1, 2) == -1.0
assert Calculator.subtract(2, 1) == 1.0
assert Calculator.subtract(1.0, 2.0) == -1.0
assert Calculator.subtract(0, 2.0) == -2.0
assert Calculator.subtract(2.0, 0.0) == 2.0
assert Calculator.subtract(-4, 2.0) == -6.0

def test_multiply():
assert Calculator.multiply(1, 2) == 2.0
assert Calculator.multiply(1.0, 2.0) == 2.0
assert Calculator.multiply(0, 2.0) == 0.0
assert Calculator.multiply(2.0, 0.0) == 0.0
assert Calculator.multiply(-4, 2.0) == -8.0

def test_divide():
# assert Calculator.divide(1, 2) == 0.5
assert Calculator.divide(1.0, 2.0) == 0.5
assert Calculator.divide(0, 2.0) == 0
assert Calculator.divide(-4, 2.0) == -2.0
# assert Calculator.divide(2.0, 0.0) == 'Cannot divide by 0'
11 changes: 0 additions & 11 deletions demo/coverage-test/coverage.test.ts

This file was deleted.

21 changes: 0 additions & 21 deletions demo/coverage-test/coverage.ts

This file was deleted.

1 change: 1 addition & 0 deletions demo/requirements.txt
@@ -0,0 +1 @@
pytest-cov