How to run a github action only on a specified folder? - github-actions

I have a monorepo setup and I want to introduce CI/CD into it using Github actions. I want a separate workflow for each service. So far, I have figured out that you can use path filtering to limit when an action is run BUT I have yet to figure out how to have the action run only on a specified folder/path.
This is my current structure:
mono-repo --
|
|- services --
| |- service1
| |- service2
|- .github --
|- workflows --
|- service1.yaml
|- service2.yaml
Any help is deeply appreciated. Thank you in advance.

Related

What does github actions "uses: ./" do?

Does anyone know what this does ?
uses: ./
I see it used in quite a few places but cannot seem to find any reference for it.
The uses keyword of github actions is used to specify the action that should be executed as part of a workflow. The ./ value tells GitHub to use the action defined in the current repository, rather than referencing a pre-built action.
It's also possible to specify the path to the action within the repository, rather than using ./. For example:
steps:
- uses: ./path
with:
parameter1: value1
parameter2: value2
This would execute the action located at ./path within the repository.

Alembic, SQLAlchemy and multiple "apps" inside a project

Coming to SQLAlchemy from the world of Django, I would like to have a project split into several apps, where models and views are bunched together according to their purpose.
For example, I am writing a planner app, I would like to have Users and Plans to live in separate apps inside my project. I want to make sure that if I have to split this project into smaller ones, I would have the least amount of work to do possible.
I also would like to be able to generate and run migrations with one command correspondingly, so that I don't have to reconfigure my CI builds every time I add a model or an "app".
So far what I could come up with in this respect is
project structure:
my_planner
+- users
| +- migrations
| | +- versions
| | | +- 0000_initial.py
| | +- __init__.py
| | +- env.py
| | +- script.py.mako
| +- __init__.py
| +- models.py
+- plans (same structure as users)
alembic.ini:
[alembic]
script_location = alembic/migrations # this doesn't seem to matter
version_locations = users/migrations/versions plans/migrations/options
[users]
script_location = users/migrations
[plans]
script_location = plans/migrations
And then I had to place env.py files into my migrations folders and import the models I want to be included into automatic migrations.
However, when I generate my automatic migrations, I have to specify the exact "apps" for which I generate them and specify a branch.
PYTHONPATH=. alembic --name users revision -m 'initial' --rev-id='0000' --branch-label users --autogenerate
And when I apply the migrations, I have to apply them separately for each of the branches.
Is there a way to do these things in one command correspondingly without writing my own custom scripts? Or is there another approach to managing migrations?
Unfortunately, I've not found an out of the box way to do this. I wrote about the approach we went with here.
The gist of it is;
Create common migration functionality
Add a migrations directory with app specific information to each app(schema, metadata)
Add your relevant app sections to the alembic.ini file, referring to each directory
Use branches starting from the base to track each app's migrations separately

GitHub actions splitting workflow file

Is it possible to split a GitHub Actions workflow file and reference it from other? I need to deploy an application into multiple environments i.e. staging and production and would like to share half of the steps to minimize maintenance.
You can split each action in the following file format:
folder named "test-action"
.github/test-action/action.yml
with contents
name: test-action
description: test action
inputs:
test_input:
description: key
required: true
runs:
using: composite
steps:
- name: echo test
shell: bash
run: |
echo ${{inputs.test_input}}
then you can refer to the action from any yml:
- name: test-action
uses: ./.github/test-action
with:
test_input: "test-string-value"
the key here was to make sure that the file within your named action folder would be called "action.yml"
It seems like there is no way as CircleCI allows defining commands that are a set of steps: https://github.community/t5/GitHub-Actions/reusing-sharing-inheriting-steps-between-jobs-declarations/td-p/37849
At this moment, I guess we can use repository_dispatch as a workaround.
In this example, it handles events between repositories, but I think we can apply this in same repository: https://blog.marcnuri.com/triggering-github-actions-across-different-repositories/

hudson to build only changed project

I have a requirement to build only changed project in hudson. We have out repository structure as
Projects/
------- Project A/src
------- Project B/src
------- Project C/src
We have arount 100+ indipendent projects in
I have a job configured in hudson which monitors the entire projects folder for changes (svn update).
What I'm trying to achieve is to build only the project which gets changed by passing the project name as argument for my build script
like ..... ant Project B ( upon changes in projectB). Is this feasible? Please guide me through.
Thanks

Flash Builder folder structure + .fla workflow

I built 3 variations of a game for different platforms (i.e. Facebook, mobile etc.) in Flash CS4.
I now have the following structure (5 folders):
Facebook
Mobile
Website
Shared_classes
Shared_assets
In each of the top three folders there is a .fla file.
Every .fla uses assets and classes from the "shared folders" but also platform-unique code.
I would now like to migrate this project to Flash Builder but
1) what is the best approach to stay organized?
2) what is the best .fla file workflow?
Well, that depends... if you ever want to migrate to Flex4 and use Maven2 to automate the build, you might want to organize your project as follows:
project-folder
|- common
| |- CommonModule.fla
| |- src
| |- test
|- platform1
| |- Platform1Module.fla
| |- src
| |- test
|- platform2
| |- Platform2Module.fla
| |- src
| |- test
|- ...
I unfortunately didn't organize it this way, and have recently been clobbered when trying to switch away from Adobe's over-priced IDE that doesn't even support building from the commandline. (How on earth is one supposed to perform integration testing or define pre-/post-commit hooks without commandline builds?)