From fc65b6a6f86e1dab20198a358708958e55ad53e0 Mon Sep 17 00:00:00 2001 From: Greg Stephens Date: Thu, 28 Nov 2024 20:32:02 -0800 Subject: [PATCH] test train model --- .github/workflows/test-train-model.yml | 75 ++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/test-train-model.yml diff --git a/.github/workflows/test-train-model.yml b/.github/workflows/test-train-model.yml new file mode 100644 index 0000000..fd73d51 --- /dev/null +++ b/.github/workflows/test-train-model.yml @@ -0,0 +1,75 @@ +name: Lint and Test PR +on: + workflow_dispatch: +# on: +# pull_request: +# paths-ignore: +# - "README.md" +# - "Makefile" +# - "Dockerfile" + +jobs: + lint-testing: + name: Code Formatting Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.10 + uses: actions/setup-python@v1 + with: + python-version: 3.10 + # - name: Install dependencies + # run: | + # python -m pip install -U pip + # pip install -r requirements-dev.txt + - name: Code Formatting Tests + working-directory: ${{ github.workspace }} + run: | + make lint + type-testing: + name: Type Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.10 + uses: actions/setup-python@v1 + with: + python-version: 3.10 + # - name: Install dependencies + # run: | + # python -m pip install -U pip + # pip install -r requirements-dev.txt + - name: Type Checking + working-directory: ${{ github.workspace }} + run: | + make types + training-testing: + name: Training and Testing + runs-on: ubuntu-latest + needs: [lint-testing, type-testing] + steps: + - uses: actions/checkout@v1 + - id: files + uses: jitterbit/get-changed-files@v1 + - name: set_training + if: | + contains( steps.files.outputs.all, 'data/' ) + || contains( steps.files.outputs.all, 'config.yml' ) + run: echo "RUN_TRAINING=true" >> $GITHUB_ENV + - name: Rasa Train and Test GitHub Action + if: env.RUN_TRAINING == 'true' + uses: RasaHQ/rasa-train-test-gha@main + with: + rasa_image: 'rasa/rasa-pro' + rasa_version: '3.10.11' + test_type: none + data_validate: false + cross_validation: false + publish_summary: false + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Upload model + if: github.ref == 'refs/heads/main' + uses: actions/upload-artifact@main + with: + name: model + path: models diff --git a/README.md b/README.md index 20dd28f..b86f20e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Rasa Pro CI/CD Example +Example Rasa Pro project with Github CI/CD workflow to build action server and model. \ No newline at end of file