chore: share gh actions logic between workflows

pull/2850/head
Audric Ackermann 9 months ago
parent 2d9fb7f18a
commit 509dd76b49

@ -30,44 +30,7 @@ jobs:
- name: Checkout git repo - name: Checkout git repo
uses: actions/checkout@v3 uses: actions/checkout@v3
# we stay on v2 even if there is a v3 because the v3 logic is less flexible for our usecase - uses: ./actions/setup_and_build
- name: Install node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v3
if: runner.os != 'Windows'
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
# Not having this will break the windows build because the PATH won't be set by msbuild.
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3.1
if: runner.os == 'Windows'
- name: Setup node for windows
if: runner.os == 'Windows'
run: |
npm install --global yarn node-gyp@latest
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --network-timeout 600000 --force
- name: Generate and concat files
run: yarn build-everything
- name: Lint Files
# no need to lint files on all platforms. Just do it once on the quicker one
if: runner.os == 'Linux'
run: yarn lint-full
- name: Unit Test
run: yarn test
- name: Build windows production binaries - name: Build windows production binaries
if: runner.os == 'Windows' if: runner.os == 'Windows'

@ -28,36 +28,7 @@ jobs:
- name: Checkout git repo - name: Checkout git repo
uses: actions/checkout@v3 uses: actions/checkout@v3
# we stay on v2 even if there is a v3 because the v3 logic is less flexible for our usecase - uses: ./actions/setup_and_build
- name: Install node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v3
if: runner.os != 'Windows'
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
#Not having this will break the windows build because the PATH won't be set by msbuild.
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3.1
if: runner.os == 'Windows'
- name: Setup node for windows
if: runner.os == 'Windows'
run: |
npm install --global node-gyp@latest
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --network-timeout 600000 --force
- name: Generate and concat files
run: yarn build-everything
- name: Lint Files - name: Lint Files
# no need to lint files on all platforms. Just do it once on the quicker one # no need to lint files on all platforms. Just do it once on the quicker one

@ -22,44 +22,7 @@ jobs:
- name: Checkout git repo - name: Checkout git repo
uses: actions/checkout@v3 uses: actions/checkout@v3
# we stay on v2 even if there is a v3 because the v3 logic is less flexible for our usecase - uses: ./actions/setup_and_build
- name: Install node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v3
if: runner.os != 'Windows'
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
#Not having this will break the windows build because the PATH won't be set by msbuild.
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3.1
if: runner.os == 'Windows'
- name: Setup node for windows
if: runner.os == 'Windows'
run: |
npm install --global node-gyp@latest
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --network-timeout 600000 --force
- name: Generate and concat files
run: yarn build-everything
- name: Lint Files
# no need to lint files on all platforms. Just do it once on the quicker one
if: runner.os == 'Linux'
run: yarn lint-full
- name: Unit Test
run: yarn test
- name: Build windows production binaries - name: Build windows production binaries
if: runner.os == 'Windows' if: runner.os == 'Windows'

@ -0,0 +1,37 @@
name: 'Setup and build'
description: 'Setup and build Session Desktop'
runs:
using: 'composite'
steps:
- name: Install node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v3
if: runner.os != 'Windows'
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
# Not having this will break the windows build because the PATH won't be set by msbuild.
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3.1
if: runner.os == 'Windows'
- name: Setup node for windows
if: runner.os == 'Windows'
shell: bash
run: |
yarn global add node-gyp@latest
- name: Install dependencies
shell: bash
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --network-timeout 600000
- name: Generate and concat files
shell: bash
run: yarn build-everything

@ -25,7 +25,7 @@ export type StatusLightType = {
glowStartDelay: number; glowStartDelay: number;
glowDuration: number; glowDuration: number;
color?: string; color?: string;
dataTestId?: string dataTestId?: string;
}; };
const StyledCountry = styled.div` const StyledCountry = styled.div`
@ -143,7 +143,7 @@ const OnionPathModalInner = () => {
export type OnionNodeStatusLightType = { export type OnionNodeStatusLightType = {
glowStartDelay: number; glowStartDelay: number;
glowDuration: number; glowDuration: number;
dataTestId?: string dataTestId?: string;
}; };
/** /**
@ -190,7 +190,7 @@ export const ActionPanelOnionStatusLight = (props: {
handleClick: () => void; handleClick: () => void;
id: string; id: string;
}) => { }) => {
const { isSelected, handleClick, id } = props; const { isSelected, handleClick, id } = props;
const onionPathsCount = useSelector(getOnionPathsCount); const onionPathsCount = useSelector(getOnionPathsCount);
const firstPathLength = useSelector(getFirstOnionPathLength); const firstPathLength = useSelector(getFirstOnionPathLength);
@ -219,8 +219,8 @@ export const ActionPanelOnionStatusLight = (props: {
glowStartDelay={0} glowStartDelay={0}
noScale={true} noScale={true}
isSelected={isSelected} isSelected={isSelected}
dataTestId={"path-light-container"} dataTestId={'path-light-container'}
dataTestIdIcon={"path-light-svg"} dataTestIdIcon={'path-light-svg'}
id={id} id={id}
/> />
); );

@ -198,9 +198,6 @@ export const SessionIcon = (props: SessionIconProps) => {
const iconDimensions = getIconDimensionFromIconSize(iconSize); const iconDimensions = getIconDimensionFromIconSize(iconSize);
const iconDef = icons[iconType]; const iconDef = icons[iconType];
const ratio = iconDef?.ratio || 1; const ratio = iconDef?.ratio || 1;
if (iconType === 'circle') {
console.warn('props', props);
}
return ( return (
<SessionSvg <SessionSvg

Loading…
Cancel
Save