Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create test.yml #2

Open
wants to merge 10 commits into
base: test
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 21 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,17 @@ jobs:
matrix:
wasm_simd: ['yes', 'no']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: sudo apt update && sudo apt -y install docker

- run: |
sudo curl -L https://github.com/docker/compose/releases/download/v2.30.3/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

- run: docker-compose pull

- name: Extract bench signature from git log
Expand Down Expand Up @@ -78,10 +85,17 @@ jobs:
run:
working-directory: src/emscripten
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: sudo apt update && sudo apt -y install docker

- run: |
sudo curl -L https://github.com/docker/compose/releases/download/v2.30.3/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

- run: docker-compose pull emscripten node

- name: Extract bench signature from git log
Expand All @@ -104,16 +118,9 @@ jobs:
docker-compose run -e uci_exe="node public/uci.js" -e sign_ref=${{ env.sign_ref }} -e UCI_NNUE_FILE="../${{ env.default_net }}" node
bash tests/bench-signature.sh

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: no-embedded-nnue
path: src/emscripten/public/stockfish*

- name: Publish to NPM
if: startsWith(github.ref, 'refs/tags/')
working-directory: src/emscripten/public
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
name: fairy-stockfish.wasm
path: src/emscripten/public/*
compression-level: 9
if-no-files-found: error
52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Example Workflow

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
print-urls:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Print System Information
run: |
lscpu
lsmem
df -h
echo ""
physical_cpus=$(grep 'physical id' /proc/cpuinfo | sort -u | wc -l)
cores_per_cpu=$(grep 'cpu cores' /proc/cpuinfo | uniq | awk -F: '{print $2}')
total_cores=$((physical_cpus * cores_per_cpu))
echo "Total CPU cores: $total_cores"
echo ""

- name: Print repository URL
run: |
echo "Repository URL: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"

- name: Print Pull Request URL
if: github.event_name == 'pull_request'
run: |
echo "Pull Request URL: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/pull/${{ github.event.pull_request.number }}"

- name: Print source and target branch names
run: |
echo "Source Branch: ${{ github.event.pull_request.head.ref }}"
echo "Target Branch: ${{ github.event.pull_request.base.ref }}"

- name: Print source repository URL and branch name
run: |
source_repo_url="${GITHUB_SERVER_URL}/${{ github.event.pull_request.head.repo.full_name }}"
source_branch="${{ github.event.pull_request.head.ref }}"
echo "Source Repository URL: $source_repo_url"
echo "Source Branch: $source_branch"

- name: Print target repository URL and branch name
run: |
target_repo_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
target_branch="${{ github.event.pull_request.base.ref }}"
echo "Target Repository URL: $target_repo_url"
echo "Target Branch: $target_branch"