diff --git a/.github/workflows/run-tests/action.yml b/.github/workflows/run-tests/action.yml new file mode 100644 index 0000000..4c047d5 --- /dev/null +++ b/.github/workflows/run-tests/action.yml @@ -0,0 +1,25 @@ +name: 'Run tests' +inputs: + python-version: + required: true + rf-version: + required: true + terminal: + required: true +runs: + using: "composite" + steps: + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: ${{ inputs.python-version }} + cache: 'pip' + - name: Install dependencies + shell: ${{ inputs.terminal }} + run: | + pip install -r requirements.txt + pip install robotframework==${{ inputs.rf-version }} + - name: Run tests + shell: ${{ inputs.terminal }} + run: | + invoke test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5922d9c..2a1868f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Tests simple +name: Tests on: push: @@ -20,6 +20,8 @@ jobs: run: | echo 'PYTHONS=["3.10.11", "3.11.6", "3.12.0"]' >> $GITHUB_OUTPUT echo 'RF_VERSIONS=["3.2.2", "4.1.3", "5.0.1", "6.1.1"]' >> $GITHUB_OUTPUT + + windows: runs-on: windows-latest needs: @@ -33,21 +35,15 @@ jobs: steps: - name: Checkout the repository uses: actions/checkout@v4 - - name: Install Python - uses: actions/setup-python@v4 + - name: Run tests + uses: ./.github/workflows/run-tests with: python-version: ${{ matrix.python }} - cache: 'pip' - - name: Install dependencies - run: | - pip install -r requirements.txt - pip install robotframework==${{ matrix.rf-version }} - - name: Run tests - run: | - invoke test + rf-version: ${{ matrix.rf-version }} + terminal: "pwsh" - macos: - runs-on: macos-latest + linux: + runs-on: ubuntu-latest needs: - generate-matrix strategy: @@ -55,25 +51,18 @@ jobs: matrix: python: ${{ fromJSON(needs.generate-matrix.outputs.python-versions) }} rf-version: ${{ fromJSON(needs.generate-matrix.outputs.rf-versions) }} - name: MacOS (${{ matrix.python }}, robotframework-${{ matrix.rf-version }}) + name: Linux (${{ matrix.python }}, robotframework-${{ matrix.rf-version }}) steps: - name: Checkout the repository uses: actions/checkout@v4 - - name: Install Python - uses: actions/setup-python@v4 + - name: Run tests + uses: ./.github/workflows/run-tests with: python-version: ${{ matrix.python }} - cache: 'pip' - - name: Install dependencies - run: | - pip install -r requirements.txt - pip install robotframework==${{ matrix.rf-version }} - - name: Run tests - run: | - invoke test - - linux: - runs-on: ubuntu-latest + rf-version: ${{ matrix.rf-version }} + terminal: "bash" + macos: + runs-on: macos-latest needs: - generate-matrix strategy: @@ -81,19 +70,13 @@ jobs: matrix: python: ${{ fromJSON(needs.generate-matrix.outputs.python-versions) }} rf-version: ${{ fromJSON(needs.generate-matrix.outputs.rf-versions) }} - name: Linux (${{ matrix.python }}, robotframework-${{ matrix.rf-version }}) + name: MacOS (${{ matrix.python }}, robotframework-${{ matrix.rf-version }}) steps: - name: Checkout the repository uses: actions/checkout@v4 - - name: Install Python - uses: actions/setup-python@v4 + - name: Run tests + uses: ./.github/workflows/run-tests with: python-version: ${{ matrix.python }} - cache: 'pip' - - name: Install dependencies - run: | - pip install -r requirements.txt - pip install robotframework==${{ matrix.rf-version }} - - name: Run tests - run: | - invoke test + rf-version: ${{ matrix.rf-version }} + terminal: "bash"