Skip to content

Commit

Permalink
Ignore certain jobs also when running act + add README
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensWe committed Aug 20, 2024
1 parent 6cf4a50 commit 2003e93
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install poetry
run: pipx install poetry

- name: Set up Python ${{ env.python-version }}
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
Expand All @@ -56,7 +56,7 @@ jobs:
- name: Install poetry
run: pipx install poetry

- name: Set up Python ${{ env.python-version }}
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
Expand Down Expand Up @@ -163,6 +163,7 @@ jobs:

build:
needs: [test-local, test-compose]
if: ${{ !github.event.act }}
runs-on: ubuntu-latest
permissions:
packages: write
Expand Down Expand Up @@ -287,7 +288,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
needs: [build]
if: ${{ github.event_name == 'push' }}
if: ${{ github.event_name == 'push' && !github.event.act}}
permissions:
actions: write
steps:
Expand Down Expand Up @@ -315,7 +316,7 @@ jobs:
notifyMattermost:
runs-on: ubuntu-latest
needs: [lint, security, test-local, test-compose, build ]
if: ${{ always() && contains(needs.*.result, 'failure') && !env.ACT}}
if: ${{ always() && contains(needs.*.result, 'failure') && !github.event.act}}
steps:
- uses: mattermost/action-mattermost-notify@master
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ An example command:
```shell
./check-state urn:nl:aivt:ir:td:1.0 urn:nl:aivt:ir:iama:1.0 example/system_test_card.yaml
```

### For developers

When running the GitHub actions locally you can use [act](https://github.com/nektos/act), to do this run change the
matrix in the `ci.yml` of the `test-local` job to have only python version 3.11. Then run the following command:
```shell
act -W '.github/workflows/ci.yml' -s GITHUB_TOKEN="$(gh auth token)" --artifact-server-path tmp/artifacts -e act_event.json
```
3 changes: 3 additions & 0 deletions act_event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"act": true
}

0 comments on commit 2003e93

Please sign in to comment.