big update for args #46
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
name: CMake on a single platform | |
on: | |
push: | |
branches: [ "master" ] | |
paths: | |
- 'CMakeLists.txt' | |
- 'src/**' | |
- 'tests/**' | |
- 'include/**' | |
- '.github/workflows/*.yml' | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: check version | |
run: cmake --version && g++ --version | |
- name: Configure CMake | |
working-directory: ${{github.workspace}}/tests | |
run: cmake -S . -B build | |
- name: Build | |
working-directory: ${{github.workspace}}/tests | |
run: cmake --build build --config ${{env.BUILD_TYPE}} | |
- name: Test | |
working-directory: ${{github.workspace}}/tests/build | |
run: ctest -C ${{env.BUILD_TYPE}} -V | |
run-graph: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure CMake | |
working-directory: ${{github.workspace}} | |
run: cmake -S . -B build | |
- name: Build | |
working-directory: ${{github.workspace}} | |
run: cmake --build build --config ${{env.BUILD_TYPE}} | |
- name: Directory | |
working-directory: ${{github.workspace}}/build | |
run: mkdir graph-results | |
- name: Run little_n_little_p | |
working-directory: ${{github.workspace}}/build | |
run: ./ggraph -n 100 -p 0.03 -o graph-results/little_n_little_p.gml | |
- name: Run middle_n_middle_p | |
working-directory: ${{github.workspace}}/build | |
run: ./ggraph -n 500 -p 0.01 -o graph-results/middle_n_middle_p.gml | |
- name: Run little_n_big_p | |
working-directory: ${{github.workspace}}/build | |
run: ./ggraph -n 100 -p 0.3 -o graph-results/little_n_big_p.gml | |
- name: Run big_n_little_p | |
working-directory: ${{github.workspace}}/build | |
run: ./ggraph -n 1000 -p 0.001 -o graph-results/big_n_little_p.gml | |
- name: Run big_n_big_p | |
working-directory: ${{github.workspace}}/build | |
run: ./ggraph -n 1000 -p 0.3 -o graph-results/big_n_big_p.gml | |
- name: Run middle_n_middle_p | |
working-directory: ${{github.workspace}}/build | |
run: ./ggraph -n 500 -p 0.01 -o graph-results/middle_n_middle_p.gml | |
- name: Upload results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: graph-results | |
path: ${{github.workspace}}/build/graph-results/ | |
upload: | |
needs: [run-graph] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Go to result branch | |
run: | | |
git checkout result | |
git pull | |
- name: Download | |
uses: actions/download-artifact@v3.0.2 | |
with: | |
name: graph-results | |
path: ${{github.workspace}} | |
- name: Commit file | |
working-directory: ${{github.workspace}} | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add . | |
git commit -a -m "Results" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: result | |
force: true | |
bfs-algo: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure CMake | |
working-directory: ${{github.workspace}} | |
run: cmake -S . -B build | |
- name: Build | |
working-directory: ${{github.workspace}} | |
run: cmake --build build --config ${{env.BUILD_TYPE}} | |
- name: run bfs | |
working-directory: ${{github.workspace}}/build | |
run: ./ggraph -algo bfs -n 10000 -p 0.002 | |
dfs-algo: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure CMake | |
working-directory: ${{github.workspace}} | |
run: cmake -S . -B build | |
- name: Build | |
working-directory: ${{github.workspace}} | |
run: cmake --build build --config ${{env.BUILD_TYPE}} | |
- name: run dfs | |
working-directory: ${{github.workspace}}/build | |
run: ./ggraph -algo dfs -n 10000 -p 0.002 |