Skip to content

Commit

Permalink
feat: install old platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
alkoleft committed Nov 17, 2024
1 parent b1c806e commit 6137ea7
Show file tree
Hide file tree
Showing 16 changed files with 426 additions and 71 deletions.
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@

## Использование

Действие позволяет устанавливать 1С:Предприятие и 1C:EDT для использования в ваших рабочих процессах (workflows).
Действие позволяет устанавливать 1С:Предприятие и 1C:EDT для использования в
ваших рабочих процессах (workflows).

Позволяет:

* Скачивание дистрибутивов с `https://releases.1c.ru`, необходимо указать учетные данные
* Установка в Windows и Linux
* Кеширование скаченных дистрибутивов
* Кеширование инсталляции
- Скачивание дистрибутивов с `https://releases.1c.ru`, необходимо указать
учетные данные
- Установка в Windows и Linux
- Кеширование скаченных дистрибутивов
- Кеширование инсталляции

### Установка 1С:Предприятие

Expand All @@ -30,7 +32,7 @@ jobs:
type: onec # Тип устанавливаемого приложения
onec_version: ${{ inputs.v8_version }}
cache: ${{runner.os == 'Windows'}}
env:
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
```
Expand All @@ -42,16 +44,16 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Установка 1C:EDT
uses: 1CDevFlow/onec-setup-action@main
with:
type: edt # Тип устанавливаемого приложения
edt_version: ${{ inputs.edt_version }}
cache: true
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
timeout-minutes: 30
- name: Установка 1C:EDT
uses: 1CDevFlow/onec-setup-action@main
with:
type: edt # Тип устанавливаемого приложения
edt_version: ${{ inputs.edt_version }}
cache: true
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
timeout-minutes: 30
```
## Contributing
Expand Down
26 changes: 24 additions & 2 deletions __tests__/installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import * as core from '@actions/core'
import * as installer from '../src/installer'
import * as dotenv from 'dotenv'

// Mock the GitHub Actions core library
const debugMock = jest.spyOn(core, 'debug')
Expand Down Expand Up @@ -36,7 +37,7 @@ type Input = { [key: string]: string }
describe('action', () => {
// We need to copy/restore the whole property definition, not just the raw value
const realPlatform = Object.getOwnPropertyDescriptor(process, 'platform')

dotenv.config()
beforeEach(() => {
jest.clearAllMocks()
})
Expand All @@ -59,7 +60,7 @@ describe('action', () => {
new Map()
// Set the action's inputs as return values from core.getInput()
getInputMock.mockImplementation((name: string): string => {
return input[name]
return input[name]n
})
getBooleanInput.mockImplementation((name: string): boolean => {
return input[name] === 'true'
Expand All @@ -69,5 +70,26 @@ describe('action', () => {
expect(runMock).toHaveReturned()
},
TIMEOUT
),
it(
'Install 1C:Enterprise',
async () => {
const input: Input = {
type: 'onec',
onec_version: '8.3.14.2095',
offline: 'true'
}
// Set the action's inputs as return values from core.getInput()
getInputMock.mockImplementation((name: string): string => {
return input[name]
})
getBooleanInput.mockImplementation((name: string): boolean => {
return input[name] === 'true'
})

await installer.run()
expect(runMock).toHaveReturned()
},
TIMEOUT * 10
)
})
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: 'Installer 1C:Enterprise 8 and 1C:EDT'
description: 'Allows you to install 1C:Enterprise 8 or 1C:EDT of the required version'
description:
'Allows you to install 1C:Enterprise 8 or 1C:EDT of the required version'
author: '1CDevFlow'

# Add your action's branding here. This will appear on the GitHub Marketplace.
Expand Down
Loading

0 comments on commit 6137ea7

Please sign in to comment.