-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (45 loc) · 1.52 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Linting & Execute Integration Test in the Container
on:
push:
branches:
- dependabot/** #branches are generated by https://github.com/dependabot
pull_request:
types:
- opened
- synchronize
jobs:
build-docker-image:
name: Step 1 - Workflow Call
secrets: "inherit"
uses: ./.github/workflows/build-container.yml
test:
env:
image_name: ghcr.io/${{ github.repository }}/rtldev_mid_dnscontrol:latest
docker_options: |
--name dstack-dnscontrol
--volume ${{ github.workspace }}:/usr/share/rtldev-middleware-dnscontrol-dnsconfig:cached
docker_exec_commands: |
cd /usr/share/rtldev-middleware-dnscontrol-dnsconfig
export GITHUB_CLI=true
zsh /post-create.sh && zsh ./tests/integration.sh
name: Step 2 - Linting & Testing
runs-on: ubuntu-latest
needs: build-docker-image
timeout-minutes: 12
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run Tests & Lint codebase in a docker Container
run: |
DOCKER_OPTS=${docker_options//$'\n'/' '}
docker run -dit $DOCKER_OPTS ${{ env.image_name }}
docker exec dstack-dnscontrol zsh -c "su - vscode -c \"${docker_exec_commands//$'\n'/';'}\""