After having our releaseable component (our docker file), we can now run our system tests to promote the artifact.
In the repository we have made two different system tests; component test and performance test.
Both requires your docker username and password as env, and a ci/component-test.sh
script that runs a docker-compose file with component tests.
- Add job named
Component-test
, which will runci/component-test.sh
script that runs a docker-compose file with component tests.
- name: Execute component test
run: chmod +x ci/component-test.sh && ci/component-test.sh
-
This job needs to be dependent on
Docker-image
job. -
Add another job named
Performance-test
, which will runci/performance-test.sh
script that runs a docker-compose file with performance tests. (Same YAML structure as above) -
It too needs to be dependent on
Docker-image
job.
If you strugle and need to see the whole Solution you can extend the section below.
Solution
Component-test:
runs-on: ubuntu-latest
needs: Docker-image
steps:
- name: Download code
uses: actions/download-artifact@v3
with:
name: code
path: .
- name: Execute component test
run: chmod +x ci/component-test.sh && ci/component-test.sh
Performance-test:
runs-on: ubuntu-latest
needs: Docker-image
steps:
- name: Download code
uses: actions/download-artifact@v3
with:
name: code
path: .
- name: Execute performance test
run: chmod +x ci/performance-test.sh && ci/performance-test.sh