mirror of
https://github.com/actions/runner-container-hooks.git
synced 2025-12-14 08:36:45 +00:00
34 lines
946 B
TypeScript
34 lines
946 B
TypeScript
import * as fs from 'fs'
|
|
import { containerBuild } from '../src/dockerCommands'
|
|
import TestSetup from './test-setup'
|
|
|
|
let testSetup
|
|
let runContainerStepDefinition
|
|
const runContainerStepInputPath = `${__dirname}/../../../examples/run-container-step.json`
|
|
|
|
describe('container build', () => {
|
|
beforeEach(() => {
|
|
testSetup = new TestSetup()
|
|
testSetup.initialize()
|
|
|
|
let runContainerStepJson = fs.readFileSync(
|
|
runContainerStepInputPath,
|
|
'utf8'
|
|
)
|
|
runContainerStepDefinition = JSON.parse(runContainerStepJson.toString())
|
|
runContainerStepDefinition.image = ''
|
|
const actionPath = testSetup.initializeDockerAction()
|
|
runContainerStepDefinition.dockerfile = `${actionPath}/Dockerfile`
|
|
})
|
|
|
|
afterEach(() => {
|
|
testSetup.teardown()
|
|
})
|
|
|
|
it('should build container', async () => {
|
|
await expect(
|
|
containerBuild(runContainerStepDefinition, 'example-test-tag')
|
|
).resolves.not.toThrow()
|
|
})
|
|
})
|