Apply changes according to: https://github.com/banhala/gh-action-mute… #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
# branches: | |
# - main | |
pull_request: | |
branches: | |
- 'main' | |
workflow_dispatch: | |
jobs: | |
simple_test: | |
runs-on: ubuntu-latest | |
name: Simple mutex test | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up mutex | |
uses: ./ | |
- run: | | |
echo "I am protected!" | |
sleep 5 | |
two_clients_test_setup: | |
runs-on: ubuntu-latest | |
name: Set up two clients test | |
needs: [simple_test] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Plant faulty lock (step 1) | |
run: | | |
# Prevent dequeue | |
sed -i "/^ post-entrypoint:/d" ./action.yml | |
- name: Plant faulty lock (step 2) | |
uses: ./ | |
with: | |
branch: gh-mutex-two-clients-test | |
two_clients_test_client_1: | |
runs-on: ubuntu-latest | |
name: Two clients test (client 1) | |
needs: [two_clients_test_setup] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up mutex | |
uses: ./ | |
with: | |
branch: gh-mutex-two-clients-test | |
force-unlock-timeout: 21 | |
- run: | | |
echo "I am protected! (Client 1)" | |
sleep 20 | |
two_clients_test_client_2: | |
runs-on: ubuntu-latest | |
name: Two clients test (client 2) | |
needs: [two_clients_test_setup] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up mutex | |
uses: ./ | |
with: | |
branch: gh-mutex-two-clients-test | |
force-unlock-timeout: 21 | |
- run: | | |
echo "I am protected! (Client 2)" | |
sleep 20 | |
debug_test: | |
runs-on: ubuntu-latest | |
name: Test the debug flag | |
needs: [two_clients_test_client_1,two_clients_test_client_2] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up mutex | |
uses: ./ | |
with: | |
debug: "true" | |
- run: | | |
echo "I am protected!" | |
sleep 5 |