fix: allow for other archs (#1239)

* fix: allow for other archs

* fix: platform tests
This commit is contained in:
Tom Hu
2024-01-31 09:18:52 -08:00
committed by GitHub
parent 98ab2c591b
commit a7b945cea4
6 changed files with 25 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
os: [macos-latest, windows-latest, ubuntu-latest, macos-latest-xlarge]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
@@ -76,4 +76,4 @@ jobs:
name: codecov-version
version: v0.2.0
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -9,7 +9,6 @@
`v4` of the Codecov GitHub Action will use the [Codecov CLI](https://github.com/codecov/codecov-cli) to upload coverage reports to Codecov.
Breaking Changes
- No current support for `aarch64` and `alpine` architectures.
- Tokenless uploading is unsupported. However, PRs made from forks to the upstream public repos will support tokenless (e.g. contributors to OS projects do not need the upstream repo's Codecov token)
- Various arguments to the Action have been removed
@@ -21,6 +20,14 @@ To integrate Codecov with your Actions pipeline, specify the name of this reposi
This Action also requires you to [provide an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) from [codecov.io](https://www.codecov.io) (tip: in order to avoid exposing your token, [store it](https://docs.codecov.com/docs/adding-the-codecov-token#github-actions) as a `secret`).
Currently, the Action will identify linux, macos, and windows runners. However, the Action may misidentify other architectures. The OS can be specified as
- alpine
- alpine-arm64
- linux
- linux-arm64
- macos
- windows
Inside your `.github/workflows/workflow.yml` file:
```yaml

3
dist/index.js vendored
View File

@@ -32477,6 +32477,9 @@ const PLATFORMS = [
'linux',
'macos',
'windows',
'alpine',
'linux-arm64',
'alpine-arm64',
];
const setFailure = (message, failCi) => {
failCi ? core.setFailed(message) : core.warning(message);

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@@ -43,6 +43,9 @@ test('getBaseUrl', () => {
'https://cli.codecov.io/latest/linux/codecov',
'https://cli.codecov.io/latest/macos/codecov',
'https://cli.codecov.io/latest/windows/codecov.exe',
'https://cli.codecov.io/latest/alpine/codecov',
'https://cli.codecov.io/latest/linux-arm64/codecov',
'https://cli.codecov.io/latest/alpine-arm64/codecov',
]);
expect(PLATFORMS.map((platform) => {
@@ -51,19 +54,22 @@ test('getBaseUrl', () => {
'https://cli.codecov.io/v0.1.0_8880/linux/codecov',
'https://cli.codecov.io/v0.1.0_8880/macos/codecov',
'https://cli.codecov.io/v0.1.0_8880/windows/codecov.exe',
'https://cli.codecov.io/v0.1.0_8880/alpine/codecov',
'https://cli.codecov.io/v0.1.0_8880/linux-arm64/codecov',
'https://cli.codecov.io/v0.1.0_8880/alpine-arm64/codecov',
]);
});
test('isWindows', () => {
expect(PLATFORMS.map((platform) => {
return isWindows(platform);
})).toEqual([false, false, true]);
})).toEqual([false, false, true, false, false, false]);
});
test('isValidPlatform', () => {
expect(PLATFORMS.map((platform) => {
return isValidPlatform(platform);
})).toEqual([true, true, true]);
})).toEqual([true, true, true, true, true, true]);
expect(isValidPlatform('fakeos')).toBeFalsy();
});

View File

@@ -4,6 +4,9 @@ const PLATFORMS = [
'linux',
'macos',
'windows',
'alpine',
'linux-arm64',
'alpine-arm64',
];
const setFailure = (message: string, failCi: boolean): void => {