Skip to content

Commit 40d9175

Browse files
Update Action versions (#7)
1 parent f772988 commit 40d9175

File tree

5 files changed

+55
-41
lines changed

5 files changed

+55
-41
lines changed

.circleci/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
version: 2.1
22
orbs:
3-
matlab: mathworks/matlab@0.1.4
4-
codecov: codecov/codecov@1.1.1
3+
matlab: mathworks/matlab@1
4+
codecov: codecov/codecov@4
55
jobs:
66
build:
77
machine:
8-
image: ubuntu-2004:202201-02
8+
image: ubuntu-2204:current
99
steps:
1010
- checkout
1111
- matlab/install

.github/workflows/workflow.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ jobs:
44
build:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
8-
- uses: matlab-actions/setup-matlab@v0
9-
- uses: matlab-actions/run-tests@v0
7+
- uses: actions/checkout@v4
8+
- uses: matlab-actions/setup-matlab@v2
9+
- uses: matlab-actions/run-tests@v2
1010
with:
1111
source-folder: source
1212
code-coverage-cobertura: coverage.xml
13-
- uses: codecov/codecov-action@v1
13+
- uses: codecov/codecov-action@v4
1414
with:
15-
file: coverage.xml
15+
file: coverage.xml
16+
token: ${{ secrets.CODECOV_TOKEN }}

.travis.yml

-3
This file was deleted.

README.md

+29-27
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,63 @@
11
# Use MATLAB with [Codecov](https://codecov.io)
22

3-
This example shows how to run MATLAB® tests, produce a code coverage report, and upload the report to Codecov. The repository includes these files.
3+
This example shows how to run MATLAB® tests, produce code coverage results, and upload the results to Codecov. The repository includes these files.
44

55
| **File Path** | **Description** |
66
|--------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
77
| `source/quadraticSolver.m` | A function that solves quadratic equations |
88
| `tests/SolverTest.m` | A class that tests the `quadraticSolver` function |
9-
| `runMyTests.m` | A script that creates a test suite and a test runner that outputs a Cobertura code coverage report |
9+
| `runMyTests.m` | A script that creates a test suite and a test runner that produces code coverage results in Cobertura XML format |
1010
| `azure-pipelines.yml` | A configuration example for [Azure® DevOps](https://marketplace.visualstudio.com/items?itemName=MathWorks.matlab-azure-devops-extension) |
1111
| `.circleci/config.yml` | A configuration example for [CircleCI®](https://circleci.com/orbs/registry/orb/mathworks/matlab)
1212
| `.github/workflows/workflow.yml` | A configuration example for [GitHub® Actions](https://github.com/matlab-actions)
13-
| `.travis.yml` | A configuration example for [Travis CI](https://docs.travis-ci.com/user/languages/matlab/)
1413

15-
## Produce and Publish Coverage Reports
14+
## Produce and Publish Coverage Results
1615
Each of these pipeline definitions does four things:
1716

1817
1) Install the latest MATLAB release on a Linux®-based build agent.
1918
2) Run all MATLAB tests in the root of your repository, including its subfolders.
20-
3) Produce a code coverage report in Cobertura XML format for the `source` folder.
21-
4) Upload the produced artifact to Codecov.
19+
3) Produce code coverage results in Cobertura XML format for the `source` folder.
20+
4) Upload the coverage artifact to Codecov.
2221

2322
### Azure DevOps
2423

2524
```yml
2625
pool:
2726
vmImage: ubuntu-latest
2827
steps:
29-
- task: InstallMATLAB@0
30-
- task: RunMATLABTests@0
28+
- task: InstallMATLAB@1
29+
- task: RunMATLABTests@1
3130
inputs:
3231
sourceFolder: source
3332
codeCoverageCobertura: coverage.xml
34-
- script: bash <(curl -s https://codecov.io/bash)
33+
- script: |
34+
# download Codecov CLI
35+
curl -Os https://cli.codecov.io/latest/linux/codecov
36+
37+
# integrity check
38+
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step
39+
curl -Os https://cli.codecov.io/latest/linux/codecov
40+
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM
41+
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig
42+
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
43+
44+
# upload to Codecov
45+
shasum -a 256 -c codecov.SHA256SUM
46+
sudo chmod +x codecov
47+
./codecov upload-process -t $(CODECOV_TOKEN)
3548
```
3649
3750
### CircleCI
3851
3952
```yml
4053
version: 2.1
4154
orbs:
42-
matlab: mathworks/matlab@0
43-
codecov: codecov/codecov@1
55+
matlab: mathworks/matlab@1
56+
codecov: codecov/codecov@4
4457
jobs:
4558
build:
4659
machine:
47-
image: ubuntu-2004:202104-01
60+
image: ubuntu-2204:current
4861
steps:
4962
- checkout
5063
- matlab/install
@@ -64,28 +77,17 @@ jobs:
6477
build:
6578
runs-on: ubuntu-latest
6679
steps:
67-
- uses: actions/checkout@v2
68-
- uses: matlab-actions/setup-matlab@v1
69-
- uses: matlab-actions/run-tests@v1
80+
- uses: actions/checkout@v4
81+
- uses: matlab-actions/setup-matlab@v2
82+
- uses: matlab-actions/run-tests@v2
7083
with:
7184
source-folder: source
7285
code-coverage-cobertura: coverage.xml
73-
- uses: codecov/codecov-action@v1
86+
- uses: codecov/codecov-action@v4
7487
with:
7588
file: coverage.xml
7689
```
7790
78-
### Travis CI
79-
80-
```yml
81-
language: matlab
82-
script: matlab -batch 'runMyTests'
83-
after_success: bash <(curl -s https://codecov.io/bash)
84-
```
85-
86-
## Caveats
87-
* Currently, MATLAB builds that use cloud-hosted agents are available only for public projects.
88-
8991
## Links
9092
- [Community Boards](https://community.codecov.io)
9193
- [Support](https://codecov.io/support)

azure-pipelines.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
pool:
22
vmImage: ubuntu-latest
33
steps:
4-
- task: InstallMATLAB@0
5-
- task: RunMATLABTests@0
4+
- task: InstallMATLAB@1
5+
- task: RunMATLABTests@1
66
inputs:
77
sourceFolder: source
88
codeCoverageCobertura: coverage.xml
9-
- script: bash <(curl -s https://codecov.io/bash)
9+
- script: |
10+
# download Codecov CLI
11+
curl -Os https://cli.codecov.io/latest/linux/codecov
12+
13+
# integrity check
14+
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step
15+
curl -Os https://cli.codecov.io/latest/linux/codecov
16+
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM
17+
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig
18+
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
19+
20+
# upload to Codecov
21+
shasum -a 256 -c codecov.SHA256SUM
22+
sudo chmod +x codecov
23+
./codecov upload-process -t $(CODECOV_TOKEN)

0 commit comments

Comments
 (0)