Skip to content

Commit

Permalink
Change GH action to push to testlog repo
Browse files Browse the repository at this point in the history
  • Loading branch information
lbonaldo committed Oct 17, 2023
1 parent 0fed738 commit f1dd10e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 40 deletions.
45 changes: 25 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,53 @@ jobs:
fail-fast: false
matrix:
version:
- "1.6"
- "1.6" # LTS (64-bit Linux)
- "1.7"
- "1.8"
- '1' # latest stable 1.x Julia release (Linux)
- '1.9' # latest stable Julia release (Linux)
os:
- ubuntu-latest
arch:
- x64
include: # additional tests [Julia-nightly]
include: # additional tests [Julia-nightly] (Linux)
- os: ubuntu-latest
version: 'nightly'
arch: x64
allow_failure: true
steps:
- uses: actions/checkout@v3
- name: Create a new branch for test logs
- name: Create a new branch and pull test logs from repo
run: |
if [[ ${{ matrix.version }} == '1' ]]; then
git config --local user.name lbonaldo
git config --local user.email "[email protected]"
git checkout -b ${GITHUB_REF#refs/heads/}-testlogs
if [ -z "$(git ls-remote --heads origin ${GITHUB_REF#refs/heads/}-testlogs)" ] ; then # if the branch doesn't exist
echo "Branch doesn't exist. Skip fetching."
else # if a branch exists, fetch it
git fetch origin ${GITHUB_REF#refs/heads/}-testlogs
git cherry-pick $(git log -n 1 origin/${GITHUB_REF#refs/heads/}-testlogs --pretty=format:"%H")
fi
git checkout -b ${GITHUB_REF#refs/heads/}-testlogs
mkdir test/Logs; cd test/Logs
git config --global init.defaultBranch main
git init
git config --local user.name GenXProject
git config --local user.email "[email protected]"
git remote add testlog https://[email protected]/GenXProject/GenX-testlog.git
git pull testlog main
if [ -d Logs_v${{ matrix.version }} ]; then
mv Logs_v${{ matrix.version }}/*.log .
else
mkdir Logs_v${{ matrix.version }}
fi
env:
LOG_TOKEN: ${{ secrets.LOG_TOKEN }}
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- name: Commit logs and push to repo # only for 1.x versions
- name: Commit logs and push back to repo
run: |
if [[ ${{ matrix.version }} == '1' ]]; then
git add -f test/Logs
git commit -m "Update test logs"
git push -f origin ${GITHUB_REF#refs/heads/}-testlogs
fi
cd ${GITHUB_WORKSPACE}/test/Logs
mv *.log Logs_v${{ matrix.version }}
git add -f Logs_v${{ matrix.version }}
git commit -m "Update test logs for Julia v${{ matrix.version }}"
git pull --rebase testlog main # pull again to avoid conflicts from other versions
git push testlog main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: julia-actions/julia-processcoverage@v1
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ LoggingExtras = "e6f89c97-d47a-5376-807f-9c37f3926c36"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Logging", "LoggingExtras", "JLD2"]
test = ["Test", "JLD2", "Logging", "LoggingExtras"]
4 changes: 0 additions & 4 deletions test/Logs/Electrolyzer.log

This file was deleted.

4 changes: 0 additions & 4 deletions test/Logs/MethodofMorris.log

This file was deleted.

3 changes: 0 additions & 3 deletions test/Logs/MultiStage.log

This file was deleted.

4 changes: 0 additions & 4 deletions test/Logs/PiecewiseFuel_CO2.log

This file was deleted.

4 changes: 0 additions & 4 deletions test/Logs/VREStor.log

This file was deleted.

0 comments on commit f1dd10e

Please sign in to comment.