-
Notifications
You must be signed in to change notification settings - Fork 8
89 lines (81 loc) · 3.23 KB
/
Copy pathmain.yml
File metadata and controls
89 lines (81 loc) · 3.23 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on: push
jobs:
prep-testbed:
runs-on: ubuntu-24.04
name: Prepare test bed
steps:
- uses: actions/checkout@v5
- id: set-matrix
run: |
sudo apt-get install jq
sudo bash ./tests/scripts/cran/install_cran_repos.sh
echo "Result:"
echo $(sudo bash ./tests/scripts/cran/get_R_releases.sh)
echo "::set-output name=matrix::$(sudo bash ./tests/scripts/cran/get_R_releases.sh)"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
integration_tests:
needs: prep-testbed
environment: publish
name: Run integration tests for R=${{ matrix.r-version }}, with memory checker=${{ matrix.memory_checker }}
strategy:
fail-fast: false
matrix:
memory_checker:
- no_check
- valgrind
- asan_no_leak
r-version: ${{fromJson(needs.prep-testbed.outputs.matrix)}}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install exasol-integration-test-docker-environment
- name: Start ITDE
run: itde spawn-test-environment --environment-name test --database-port-forward 8888 --bucketfs-port-forward 6666 --db-mem-size 4GB --create-certificates
working-directory: /tmp
- name: Copy certificate
run: mkdir /tmp/certificate && docker cp db_container_test:/certificates/rootCA.crt /tmp/certificate/rootCA.crt
- name: Docker login
run: echo "$SECRET_DOCKER_TOKEN" | docker login --username "$SECRET_DOCKER_USER_NAME" --password-stdin
env: # Set the secret as an input
SECRET_DOCKER_USER_NAME: ${{ secrets.CI4_DOCKERHUB_USERNAME }}
SECRET_DOCKER_TOKEN: ${{ secrets.CI4_DOCKERHUB_TOKEN }}
- name: Run all tests
run: |
./tests/scripts/pull_docker_image.sh ${{ matrix.r-version }}
./tests/scripts/execute_docker_test_env.sh ${{ matrix.r-version }} ${{ matrix.memory_checker }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-main:
needs: [prep-testbed,integration_tests]
if: github.ref == 'refs/heads/main'
name: Publish to docker hub for R=${{ matrix.r-version }}
strategy:
fail-fast: false
matrix:
r-version: ${{fromJson(needs.prep-testbed.outputs.matrix)}}
runs-on: ubuntu-24.04
environment: publish
steps:
- uses: actions/checkout@v5
- name: Build new Docker image
run: "bash tests/scripts/build_docker_test_env.sh ${{ matrix.r-version }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Docker login
run: echo "$SECRET_DOCKER_TOKEN" | docker login --username "$SECRET_DOCKER_USER_NAME" --password-stdin
env: # Set the secret as an input
SECRET_DOCKER_USER_NAME: ${{ secrets.CI4_DOCKERHUB_USERNAME }}
SECRET_DOCKER_TOKEN: ${{ secrets.CI4_DOCKERHUB_TOKEN }}
- name: Push new Docker images
run: "bash tests/scripts/push_docker_image.sh ${{ matrix.r-version }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}