Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
UrazAkgultan committed Aug 29, 2024
1 parent 6e47ca0 commit 888e7b4
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Run build

on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
name: "Build (${{ matrix.os }})"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
attempt: [1, 2, 3, 4]

steps:
- name: "Checking-out code"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: "Defining node version"
uses: actions/setup-node@d86ebcd40b3cb50b156bfa44dd277faf38282d12 # v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: "Installing dependencies"
run: yarn install
- name: "Running build"
run: yarn build
timeout-minutes: 1
continue-on-error: true
- name: Retry if failed
if: ${{ failure() && matrix.attempt < 4 }}
run: echo "Retry attempt ${{ matrix.attempt }}"
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.16.0
10 changes: 10 additions & 0 deletions node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"name": "actions-test",
"version": "1.0.0",
"main": "index.js",
"license": "MIT"
"license": "MIT",
"scripts": {
"build": "node ./scripts/build.js"
}
}
19 changes: 19 additions & 0 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
main().catch((e) => {
console.error(e);
process.exit(1);
});

async function main() {
for (let i = 0; i < 100; i++) {
console.log(`Step ${i}`);
await wait();
}
}

function wait() {
return new Promise((resolve) => {
setTimeout(() => {
resolve("Done");
}, 5 * 1000);
});
}
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


0 comments on commit 888e7b4

Please sign in to comment.