diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index add847d..e9c8aa0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,12 +2,14 @@ name: Build on: push: + branches: + - main + pull_request: paths: - "data/**" - ".github/workflows/build.yml" - pull_request: - branches: - - "main" + - "pos_tagger_scripts/**" + - "dict_tools/**" jobs: build: @@ -163,6 +165,9 @@ jobs: - name: Test LT working-directory: ${{ env.LT_HOME }} + if: > + (contains(github.event.pull_request.head.commit.message, '[skip lt test]') == false) && + (contains(github.event.pull_request.labels.*.name, 'skip_lt_test') == false) run: | mvn clean install -DskipTests ./build.sh pt test diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 2a7bc0f..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,82 +0,0 @@ -# This workflow is DEPRECATED. Both deployment and building are now handled in the Build workflow as separate jobs. -name: Deploy - -on: - workflow_run: - workflows: ["Build"] - types: - - completed - workflow_dispatch: - inputs: - runid: - type: string - description: "The ID of the workflow run to download artefacts from" - required: true - # TODO: remove hardcoded id! - default: "7802717092" - -jobs: - deploy: - runs-on: ubuntu-latest - if: > - (github.event_name == 'workflow_run' && - github.event.workflow_run.conclusion == 'success' && - github.event.workflow_run.head_branch == 'main' && - github.event.workflow_run.event == 'push') || - github.event_name == 'workflow_dispatch' - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # Necessary since downloading artefacts with an 'overwrite' option is not supported - - name: Empty out src directory - run: rm -rf results/java-lt/src/* - - - name: Download artefact from upstream workflow - if: github.event_name == 'workflow_run' - uses: actions/download-artifact@v4 - with: - name: src - path: results/java-lt/src/ - run-id: ${{ github.event.workflow_run.id }} - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Debug run ID - if: github.event_name == 'workflow_dispatch' - run: | - echo "Run ID: ${{ github.event.inputs.runid }}" - - - name: Download artefact from custom workflow - if: github.event_name == 'workflow_dispatch' - uses: actions/download-artifact@v4 - with: - name: src - path: results/java-lt/src/ - run-id: ${{ github.event.inputs.runid }} - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Set dictionary version - # TODO: remove 'test-' prefix! - run: echo "PT_DICT_VERSION=test-$(git describe --tags --abbrev=0 | sed 's/^v//g')" >> $GITHUB_ENV - - - name: Set up JDK 11 for x64 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - architecture: x64 - - - name: Import GPG Key - run: echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import - - - name: Deploy to SonaType - env: - GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - working-directory: results/java-lt - run: mvn clean deploy -P release -s ${{ github.workspace }}/results/java-lt/settings.xml diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 6c3cd79..53c0de2 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -7,6 +7,12 @@ on: - "pyproject.toml" - "poetry.lock" - ".github/workflows/flake8.yml" + pull_request: + paths: + - "**/*.py" + - "pyproject.toml" + - "poetry.lock" + - ".github/workflows/flake8.yml" jobs: lint: diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e6aa9b6..3d0d402 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -8,6 +8,13 @@ on: - "pyproject.toml" - "poetry.lock" - ".github/workflows/pytest.yml" + pull_request: + paths: + - "**/*.py" + - "tests/" + - "pyproject.toml" + - "poetry.lock" + - ".github/workflows/pytest.yml" jobs: test: @@ -27,11 +34,6 @@ jobs: python-version: ${{ matrix.python-version }} - name: Set up Poetry uses: Gr1N/setup-poetry@v8 - - name: Cache Poetry virtualenv - uses: actions/cache@v2 - with: - path: ~/.cache/pypoetry/virtualenvs - key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} - name: Check Poetry config run: poetry check - name: Install dependencies diff --git a/README.md b/README.md index 005012c..7c437b6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![Flake8](https://github.com/languagetool-org/portuguese-pos-dict/actions/workflows/flake8.yml/badge.svg)](https://github.com/languagetool-org/portuguese-pos-dict/actions/workflows/flake8.yml) [![Pytest](https://github.com/languagetool-org/portuguese-pos-dict/actions/workflows/pytest.yml/badge.svg)](https://github.com/languagetool-org/portuguese-pos-dict/actions/workflows/pytest.yml) +[![Build+Test](https://github.com/languagetool-org/portuguese-pos-dict/actions/workflows/build.yml/badge.svg)](https://github.com/languagetool-org/portuguese-pos-dict/actions/workflows/build.yml) # portuguese-pos-dict