Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): early exit strategy for modules #437

Merged
merged 25 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7c639d7
fix(build): early exit strategy for modules
totallyzen Mar 1, 2024
acefaca
fix: linting
totallyzen Mar 1, 2024
76a0975
test: try to delete the running job to not show it as failed
totallyzen Mar 1, 2024
1486ada
fix: set up matrix test after file tracking
totallyzen Mar 1, 2024
6f185ac
fix: compute modules with jq
totallyzen Mar 1, 2024
c610954
fix: disable test step
totallyzen Mar 1, 2024
4ccd985
test: touch arangodb for testing
totallyzen Mar 1, 2024
0a0268b
fix: diff_relative does not include the dot
totallyzen Mar 1, 2024
ba7e9c2
fix: only kick off test job when there is anything to do
totallyzen Mar 1, 2024
1ae7ba4
fix: typo
totallyzen Mar 1, 2024
dd792d8
fix: typo
totallyzen Mar 1, 2024
c5e8778
fix: keep it simple
totallyzen Mar 1, 2024
5321245
revert: no more arangodb changes
totallyzen Mar 1, 2024
0dfabac
fix: count the modules for the test job
totallyzen Mar 1, 2024
43c5119
test: touch arangodb
totallyzen Mar 1, 2024
5111c6f
fix: docs are failing other jobs
totallyzen Mar 1, 2024
df6339d
test: try falsy/truthy values for if
totallyzen Mar 1, 2024
9d78351
revert: no more arangodb, testing 'no module' scenario
totallyzen Mar 1, 2024
1c86a0f
fix: formatting
totallyzen Mar 1, 2024
be8897b
test: include-matrix
totallyzen Mar 1, 2024
1e7962d
revert: keep it simple
totallyzen Mar 1, 2024
53035cb
fix: follow GH community recommendation on if
totallyzen Mar 1, 2024
477dc46
fix: typo
totallyzen Mar 1, 2024
7d5aed7
test: arangodb enabled again
totallyzen Mar 1, 2024
69d3507
revert: no more arangodb
totallyzen Mar 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 30 additions & 42 deletions .github/workflows/ci-community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,51 @@ name: modules

on:
push:
branches: [main]
branches: [ main ]
paths:
- "modules/**"
pull_request:
branches: [main]
branches: [ main ]
paths:
- "modules/**"

permissions:
actions: write # needed for self-cancellation

jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
module:
- arangodb
- azurite
- clickhouse
- elasticsearch
- google
- kafka
- keycloak
- localstack
- minio
- mongodb
- mssql
- mysql
- neo4j
- nginx
- opensearch
- oracle
- postgres
- rabbitmq
- redis
- selenium
- k3s
track-modules:
runs-on: ubuntu-latest
steps:
- name: Checkout contents
uses: actions/checkout@v4
with:
fetch-depth: 0 # recommended by tj-actions/changed-files
- name: Get changed files
id: changes-for-module
id: changed-files
uses: tj-actions/changed-files@v42
with:
files: |
modules/${{ matrix.module }}/**
- name: Exit early, nothing to do
if: ${{ steps.changes-for-module.outputs.any_changed == 'false' }}
path: "./modules"
diff_relative: true
dir_names: true
dir_names_exclude_current_dir: true
json: true
- name: Compute modules from files
id: compute-changes
run: |
# cancel and wait for run to end
gh run cancel ${{ github.run_id }}
gh run watch ${{ github.run_id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
modules=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | jq '.[] | split("/") | first' | jq -s -c '. | unique')
echo "computed_modules=$modules"
echo "computed_modules=$modules" >> $GITHUB_OUTPUT
outputs:
changed_modules: ${{ steps.compute-changes.outputs.computed_modules }}
test:
needs: [track-modules]
if: ${{ needs.track-modules.outputs.changed_modules != '[]' }}
strategy:
fail-fast: false
matrix:
python-version: [ "3.11" ]
module: ${{ fromJSON(needs.track-modules.outputs.changed_modules) }}
runs-on: ubuntu-latest
steps:
- name: Checkout contents
uses: actions/checkout@v4
- name: Set up Python
uses: ./.github/actions/setup-env
with:
Expand Down
3 changes: 3 additions & 0 deletions modules/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Modules

The modules directory contains all the community-supported containers that see common use cases and merit their own easy-access container.