Skip to content

Commit

Permalink
Improved GitHub Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
kojix2 committed Jan 31, 2025
1 parent b0c5f66 commit 05e1774
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- cron: "51 3 * * 6" # Runs at 03:51, only on Saturday
jobs:
build:
name: ${{ matrix.os }}
name: build ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

jobs:
build:
docs:
runs-on: ubuntu-latest

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
- "v*"

jobs:
build_release:
name: Build Release ${{ matrix.os }}
release:
name: build release ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu, macos, windows]
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ on:
- cron: "51 3 * * 6" # Runs at 03:51, only on Saturday

jobs:
build:
test:
name: ubuntu
runs-on: ubuntu-latest
strategy:
fail-fast: false

env:
HTTP_PROXY: http://localhost:3001
DEEPL_SERVER_URL: http://localhost:3000
DEEPL_AUTH_KEY: mock

steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -49,9 +54,9 @@ jobs:
- name: Test deepl-mock server with curl
run: |
curl -X POST 'http://localhost:3001/v2/translate' \
--header 'Authorization: DeepL-Auth-Key [mock]' \
--header 'Content-Type: application/json' \
curl -X POST "${HTTP_PROXY}/v2/translate" \
--header "Authorization: DeepL-Auth-Key ${DEEPL_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data '{"text":["proton beam"],"target_lang":"DE"}'
- name: Install dependencies
Expand All @@ -62,17 +67,17 @@ jobs:

- name: Build executable
run: shards build
env:
DEEPL_SERVER_URL: http://localhost:3000

- name: Run executable
run: |
set -eux
bin/deepl -i "proton beam" -t DE --debug
bin/deepl -t
bin/deepl -f
bin/deepl -u
bin/deepl glossary list
bin/deepl doc spec/fixtures/proton_beams.txt -t DE
env:
HTTP_PROXY: http://localhost:3001
DEEPL_AUTH_KEY: mock
- name: Stop deepl-mock server
if: always()
run: docker stop deepl-mock || true

0 comments on commit 05e1774

Please sign in to comment.