From b2a963638d62d7ddcc5d4c991e28e0bae6ad3ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Sun, 29 Jan 2023 11:46:20 +0100 Subject: [PATCH] TEST: update actions setup-python to v4 and checkout to v3, add caching to python (#1428) * update actions setup-python to v4 and checkout to v3, add caching to python * fix ordering of steps for poetry to be cached * poetry setup ordering * order in formatting.yml --- .github/workflows/codeql.yml | 2 +- .github/workflows/formatting.yml | 12 +++---- .github/workflows/migrations.yml | 5 ++- .github/workflows/mypy.yml | 12 +++---- .github/workflows/on-tag.yml | 4 +-- .github/workflows/regtest.yml | 61 ++++++++++++++++---------------- .github/workflows/tests.yml | 28 +++++++-------- 7 files changed, 62 insertions(+), 62 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 876c8b8af..3d2fb213e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 2 - run: git checkout HEAD^2 diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 18445899c..709ebcb3a 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -14,18 +14,18 @@ jobs: python-version: ["3.9"] poetry-version: ["1.3.1"] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v3 - name: Set up Poetry ${{ matrix.poetry-version }} uses: abatilo/actions-poetry@v2 with: poetry-version: ${{ matrix.poetry-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: "poetry" - name: Install packages run: | - poetry config virtualenvs.create false poetry install - name: Check black run: make checkblack diff --git a/.github/workflows/migrations.yml b/.github/workflows/migrations.yml index 6725d845c..03a9d7611 100644 --- a/.github/workflows/migrations.yml +++ b/.github/workflows/migrations.yml @@ -25,9 +25,9 @@ jobs: python-version: ["3.9"] poetry-version: ["1.3.1"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Set up Poetry ${{ matrix.poetry-version }} @@ -36,7 +36,6 @@ jobs: poetry-version: ${{ matrix.poetry-version }} - name: Install dependencies run: | - poetry config virtualenvs.create false poetry install sudo apt install unzip - name: Run migrations diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 4c47fafc6..ad5be69d6 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -10,18 +10,18 @@ jobs: python-version: ["3.9"] poetry-version: ["1.3.1"] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v3 - name: Set up Poetry ${{ matrix.poetry-version }} uses: abatilo/actions-poetry@v2 with: poetry-version: ${{ matrix.poetry-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: 'poetry' - name: Install dependencies run: | - poetry config virtualenvs.create false poetry install - name: Run tests run: poetry run mypy diff --git a/.github/workflows/on-tag.yml b/.github/workflows/on-tag.yml index a9f58985b..2ff8bff0c 100644 --- a/.github/workflows/on-tag.yml +++ b/.github/workflows/on-tag.yml @@ -19,7 +19,7 @@ jobs: run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - name: Checkout project - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Import environment variables id: import-env @@ -66,4 +66,4 @@ jobs: --cache-to "type=local,dest=/tmp/.buildx-cache" \ --platform linux/amd64,linux/arm64 \ --tag ${{ secrets.DOCKER_USERNAME }}/lnbits-legend:latest \ - --output "type=registry" ./ \ No newline at end of file + --output "type=registry" ./ diff --git a/.github/workflows/regtest.yml b/.github/workflows/regtest.yml index eb2630db6..7eefb5312 100644 --- a/.github/workflows/regtest.yml +++ b/.github/workflows/regtest.yml @@ -10,15 +10,16 @@ jobs: python-version: ["3.9"] poetry-version: ["1.3.1"] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v3 - name: Set up Poetry ${{ matrix.poetry-version }} uses: abatilo/actions-poetry@v2 with: poetry-version: ${{ matrix.poetry-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: "poetry" - name: Setup Regtest run: | docker build -t lnbitsdocker/lnbits-legend . @@ -29,7 +30,6 @@ jobs: sudo chmod -R a+rwx . - name: Install dependencies run: | - poetry config virtualenvs.create false poetry install - name: Run tests env: @@ -54,15 +54,16 @@ jobs: python-version: ["3.9"] poetry-version: ["1.3.1"] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v3 - name: Set up Poetry ${{ matrix.poetry-version }} uses: abatilo/actions-poetry@v2 with: poetry-version: ${{ matrix.poetry-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: "poetry" - name: Setup Regtest run: | docker build -t lnbitsdocker/lnbits-legend . @@ -73,7 +74,6 @@ jobs: sudo chmod -R a+rwx . - name: Install dependencies run: | - poetry config virtualenvs.create false poetry install - name: Run tests env: @@ -99,15 +99,16 @@ jobs: python-version: ["3.9"] poetry-version: ["1.3.1"] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v3 - name: Set up Poetry ${{ matrix.poetry-version }} uses: abatilo/actions-poetry@v2 with: poetry-version: ${{ matrix.poetry-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: "poetry" - name: Setup Regtest run: | docker build -t lnbitsdocker/lnbits-legend . @@ -118,7 +119,6 @@ jobs: sudo chmod -R a+rwx . - name: Install dependencies run: | - poetry config virtualenvs.create false poetry install - name: Run tests env: @@ -141,15 +141,16 @@ jobs: python-version: ["3.9"] poetry-version: ["1.3.1"] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v3 - name: Set up Poetry ${{ matrix.poetry-version }} uses: abatilo/actions-poetry@v2 with: poetry-version: ${{ matrix.poetry-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: "poetry" - name: Setup Regtest run: | docker build -t lnbitsdocker/lnbits-legend . @@ -184,15 +185,16 @@ jobs: python-version: ["3.9"] poetry-version: ["1.3.1"] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v3 - name: Set up Poetry ${{ matrix.poetry-version }} uses: abatilo/actions-poetry@v2 with: poetry-version: ${{ matrix.poetry-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: "poetry" - name: Setup Regtest run: | docker build -t lnbitsdocker/lnbits-legend . @@ -203,7 +205,6 @@ jobs: sudo chmod -R a+rwx . - name: Install dependencies run: | - poetry config virtualenvs.create false poetry install - name: Run tests env: @@ -219,4 +220,4 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - file: ./coverage.xml \ No newline at end of file + file: ./coverage.xml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dbbddf980..1cb563410 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,9 +10,9 @@ jobs: python-version: ["3.9"] poetry-version: ["1.3.1"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -33,18 +33,18 @@ jobs: python-version: ["3.9"] poetry-version: ["1.3.1"] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v3 - name: Set up Poetry ${{ matrix.poetry-version }} uses: abatilo/actions-poetry@v2 with: poetry-version: ${{ matrix.poetry-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: "poetry" - name: Install dependencies run: | - poetry config virtualenvs.create false poetry install - name: Run tests run: make test @@ -70,18 +70,18 @@ jobs: python-version: ["3.9"] poetry-version: ["1.3.1"] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v3 - name: Set up Poetry ${{ matrix.poetry-version }} uses: abatilo/actions-poetry@v2 with: poetry-version: ${{ matrix.poetry-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: "poetry" - name: Install dependencies run: | - poetry config virtualenvs.create false poetry install - name: Run tests env: