Skip to content

Commit

Permalink
ci: use platform-agnostic way to delete first line
Browse files Browse the repository at this point in the history
  • Loading branch information
deepyaman committed Aug 18, 2023
1 parent 543a2d1 commit 650ffad
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/ibis-backends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,6 @@ jobs:
- name: download backend data
run: just download-data

- name: delete header rows
if: matrix.backend.name == 'flink'
run: |
readonly TEST_FILES=(functional_alltypes diamonds batting awards_players)
for file in "${TEST_FILES[@]}"; do
sed -i '1d' "ci/ibis-testing-data/csv/${file}.csv"
done
- name: start services
if: matrix.backend.services != null
run: docker compose up --wait ${{ join(matrix.backend.services, ' ') }}
Expand All @@ -346,6 +338,25 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: delete header rows on ubuntu
if: matrix.os == 'ubuntu-latest' && matrix.backend.name == 'flink'
run: |
python -c "exec(\"TEST_FILES = ['functional_alltypes', 'diamonds', 'batting', 'awards_players']\nfor file in TEST_FILES:\n with open(f'ci/ibis-testing-data/csv/{file}.csv', 'r+') as f:\n f.readline()\n data=f.read()\n f.seek(0)\n f.write(data)\n f.truncate()\n\")"
- name: delete header rows on windows
if: matrix.os == 'windows-latest' && matrix.backend.name == 'flink'
run: |
python -c @"
TEST_FILES = ["functional_alltypes", "diamonds", "batting", "awards_players"]
for file in TEST_FILES:
with open(f"ci/ibis-testing-data/csv/{file}.csv", "r+") as f:
f.readline()
data=f.read()
f.seek(0)
f.write(data)
f.truncate()
"@
- name: download poetry lockfile
uses: actions/download-artifact@v3
with:
Expand Down

0 comments on commit 650ffad

Please sign in to comment.