diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f20a84d..b74e2de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e1740ee..38e4007 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,7 +6,7 @@ on: - main jobs: - build: + docs: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1689dc9..bb80530 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f52bea8..41c6172 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: @@ -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 @@ -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