Skip to content

Commit

Permalink
test: move itg exclusions to jest
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Feb 5, 2024
1 parent 49a22f7 commit 579971c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,6 @@ jobs:
- macos-13
- macos-latest
- windows-latest
exclude:
- os: macos-13
test: buildx/bake.test.itg.ts
- os: macos-latest
test: buildx/bake.test.itg.ts
- os: windows-latest
test: buildx/bake.test.itg.ts
- os: macos-13
test: buildx/install.test.itg.ts
- os: macos-latest
test: buildx/install.test.itg.ts
- os: windows-latest
test: buildx/install.test.itg.ts
steps:
-
name: Checkout
Expand All @@ -109,12 +96,19 @@ jobs:
run: yarn install
-
name: Test
run: yarn test:itg-coverage --runTestsByPath __tests__/${{ matrix.test }} --coverageDirectory=./coverage
run: |
yarn test:itg-coverage --runTestsByPath __tests__/${{ matrix.test }} --coverageDirectory=./coverage
if [ -f ./coverage/clover.xml ]; then
echo "RUN_CODECOV=true" >> $GITHUB_ENV
else
echo "RUN_CODECOV=false" >> $GITHUB_ENV
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Upload coverage
uses: codecov/codecov-action@v3
if: env.RUN_CODECOV
with:
file: ./coverage/clover.xml
flags: itg
4 changes: 3 additions & 1 deletion __tests__/buildx/bake.test.itg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ import {BakeDefinition} from '../../src/types/bake';

const fixturesDir = path.join(__dirname, '..', 'fixtures');

const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.imageOS && process.env.imageOS.startsWith('ubuntu')) ? describe : describe.skip;

beforeEach(() => {
jest.clearAllMocks();
});

describe('parseDefinitions', () => {
maybe('parseDefinitions', () => {
// prettier-ignore
test.each([
[
Expand Down
4 changes: 3 additions & 1 deletion __tests__/buildx/install.test.itg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import * as fs from 'fs';

import {Install} from '../../src/buildx/install';

describe('download', () => {
const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.imageOS && process.env.imageOS.startsWith('ubuntu')) ? describe : describe.skip;

maybe('download', () => {
// prettier-ignore
test.each(['latest'])(
'install docker %s', async (version) => {
Expand Down

0 comments on commit 579971c

Please sign in to comment.