generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from simplificator/rebuild-as-compose-action
Rewrite action as a composite action
- Loading branch information
Showing
27 changed files
with
106 additions
and
11,083 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,44 +10,46 @@ permissions: | |
contents: read | ||
|
||
jobs: | ||
test-typescript: | ||
name: TypeScript Tests | ||
test: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# cloning into "root" does not work when trying to call the action from itself | ||
# inspired by Microsoft: https://github.com/microsoft/action-python/blob/c8ec939994d7ed2ec77b7bbe59ed5f5b72fb5607/.github/workflows/test.yml#L21 | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
id: setup-node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .node-version | ||
cache: npm | ||
|
||
- name: Install Dependencies | ||
id: npm-ci | ||
run: npm ci | ||
|
||
- name: Check Format | ||
id: npm-format-check | ||
run: npm run format:check | ||
|
||
- name: Lint | ||
id: npm-lint | ||
run: npm run lint | ||
path: action | ||
clean: true | ||
|
||
- name: Run test server | ||
run: | | ||
docker compose build | ||
docker compose up & | ||
working-directory: action | ||
|
||
- name: Add SSH identity of test server to known hosts | ||
run: | | ||
mkdir -p ~/.ssh | ||
ssh-keyscan -t rsa -p 2222 127.0.0.1 >> ~/.ssh/known_hosts | ||
- name: Test | ||
id: npm-ci-test | ||
run: npm run ci-test | ||
uses: ./action | ||
with: | ||
compose-file: action/docker-compose.test.yml | ||
stack-name: david | ||
ssh-user-at-host: [email protected] | ||
ssh-port: 2222 | ||
|
||
- name: Check if test application is available | ||
run: | | ||
response=$(curl -s 'http://127.0.0.1:8888') | ||
if echo "$response" | grep -q "Hello World"; then | ||
echo "Pattern matched." | ||
exit 0 | ||
else | ||
echo "Pattern not matched." | ||
exit 1 | ||
fi | ||
shell: bash |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.