diff --git a/.github/actions/mock_tests/action.yml b/.github/actions/mock_tests/action.yml new file mode 100644 index 0000000..caee333 --- /dev/null +++ b/.github/actions/mock_tests/action.yml @@ -0,0 +1,18 @@ +name: "Build and check formatting and Mock Tests" +description: "Download Parsec Mock, install dependencies and execute all tests" + +runs: + using: "composite" + steps: + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Download Parsec Mock, install dependencies and execute all tests + run: | + curl -s -N -L https://github.com/parallaxsecond/parsec-mock/archive/refs/tags/0.1.1.tar.gz | tar xz + cd parsec-mock-0.1.1/ + python -m pip install --upgrade pip + pip install -r requirements.txt + cd .. + ./tests/ci.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c868d15..d7edebb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,19 +7,14 @@ jobs: name: Build and check formatting runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v1 + - uses: actions/checkout@v3 + - name: Install latest Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - python-version: 3.7 + toolchain: stable + rustflags: "" - name: Download Parsec Mock, install dependencies and execute all tests - run: | - curl -s -N -L https://github.com/parallaxsecond/parsec-mock/archive/refs/tags/0.1.1.tar.gz | tar xz - cd parsec-mock-0.1.1/ - python -m pip install --upgrade pip - pip install -r requirements.txt - cd .. - ./tests/ci.sh + uses: ./.github/actions/mock_tests build-msrv: name: MSRV - Build and check formatting @@ -31,15 +26,5 @@ jobs: with: toolchain: 1.66.0 rustflags: "" - - name: Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 - name: Download Parsec Mock, install dependencies and execute all tests - run: | - curl -s -N -L https://github.com/parallaxsecond/parsec-mock/archive/refs/tags/0.1.1.tar.gz | tar xz - cd parsec-mock-0.1.1/ - python -m pip install --upgrade pip - pip install -r requirements.txt - cd .. - ./tests/ci.sh + uses: ./.github/actions/mock_tests