I use github actions for integration tests.
The problem is, that the tests should not run on multiple instances with the same configuration in parallel (the test would fail).
But, it can be run once with let's say configuration 1 and once with configuration 2 in parallel.
As this blog post describes, it is not possible to secure that a workflow does not run in parallel.
Is there any way to switch configurations, that configuration 1 and configuration 2 alternately?
In that case, it would not be that likely that the workflow workflows with the same configuration runs in parallel (I could add more configurations if needed).
For example, this could be done by a global and writable (for the workflow) variable that is alternately 1 or 2 and the workflow picks that configuration.
Example workflow(the secret confToSwitch
should be switched):
name: test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: "load configuration"
run: echo "configuration=$conf" >> ./conf
env:
conf: ${{ secrets.confToSwitch }}
- name: "integration tests"
run: "mvn -B integration-test"