Skip to content

Commit

Permalink
Improvement github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
liminspace committed Aug 27, 2024
1 parent e8533e2 commit dca8274
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ jobs:
tcp-server-ver: [ 'v1.2' ]
fail-fast: false
steps:
- name: Get OS info
id: os-info
run: |
info_file="/etc/os-release"
name=$(grep "^NAME=" $info_file | sed 's/NAME="\([^"]*\)"/\1/')
ver=$(grep "^VERSION=" $info_file | sed 's/VERSION="\([0-9.]*\).*/\1/')
echo "name=$name" >> "$GITHUB_OUTPUT"
echo "ver=$ver" >> "$GITHUB_OUTPUT"
echo "full=$name$ver" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4
- name: Checkout tcp server
Expand All @@ -34,9 +43,9 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-ver }}-${{ hashFiles('requirements-tests.txt') }}
key: ${{ steps.os-info.outputs.full }}-pip-${{ matrix.python-ver }}-${{ hashFiles('requirements-tests.txt') }}
restore-keys:
${{ runner.os }}-pip-${{ matrix.python-ver }}-
${{ steps.os-info.outputs.full }}-pip-${{ matrix.python-ver }}-
- name: Install Python dependencies
run: |
pip install -U -r requirements-tests.txt
Expand All @@ -49,9 +58,9 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ env.NODE_VER }}-${{ matrix.mjml-ver }}
key: ${{ steps.os-info.outputs.full }}-npm-${{ env.NODE_VER }}-${{ matrix.mjml-ver }}
restore-keys:
${{ runner.os }}-npm-${{ env.NODE_VER }}-
${{ steps.os-info.outputs.full }}-npm-${{ env.NODE_VER }}-
- name: Install Node dependencies
run: |
npm cache verify
Expand Down Expand Up @@ -79,6 +88,15 @@ jobs:
tcp-server-ver: [ 'v1.2' ]
fail-fast: false
steps:
- name: Get OS info
id: os-info
run: |
info_file="/etc/os-release"
name=$(grep "^NAME=" $info_file | sed 's/NAME="\([^"]*\)"/\1/')
ver=$(grep "^VERSION=" $info_file | sed 's/VERSION="\([0-9.]*\).*/\1/')
echo "name=$name" >> "$GITHUB_OUTPUT"
echo "ver=$ver" >> "$GITHUB_OUTPUT"
echo "full=$name$ver" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4
- name: Checkout tcp server
Expand All @@ -95,9 +113,9 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-ver }}-${{ hashFiles('requirements-tests.txt') }}
key: ${{ steps.os-info.outputs.full }}-pip-${{ matrix.python-ver }}-${{ hashFiles('requirements-tests.txt') }}
restore-keys:
${{ runner.os }}-pip-${{ matrix.python-ver }}-
${{ steps.os-info.outputs.full }}-pip-${{ matrix.python-ver }}-
- name: Install Python dependencies
run: |
pip install -U -r requirements-tests.txt
Expand All @@ -110,9 +128,9 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ env.NODE_VER }}-${{ matrix.mjml-ver }}
key: ${{ steps.os-info.outputs.full }}-npm-${{ env.NODE_VER }}-${{ matrix.mjml-ver }}
restore-keys:
${{ runner.os }}-npm-${{ env.NODE_VER }}-
${{ steps.os-info.outputs.full }}-npm-${{ env.NODE_VER }}-
- name: Install Node dependencies
run: |
npm cache verify
Expand Down

0 comments on commit dca8274

Please sign in to comment.