Skip to content

Commit

Permalink
Update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ennoruijters committed Apr 8, 2023
1 parent 375bcd9 commit 470613b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 33 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 14
java-version: 17
distribution: temurin
- name: Install dependencies
run: brew install bison flex yaml-cpp gsl
- name: Set environment variables
Expand All @@ -24,18 +25,18 @@ jobs:
- name: Compile DFTCalc
run: cd build && make -j$NUMCORES install
- name: Checkout DFTRES
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: utwente-fmt/DFTRES
path: DFTRES
- name: Get cache revisions
id: cache-revs
run: |
cd DFTRES && echo "::set-output name=dftres::$(git rev-parse HEAD)"
echo "::set-output name=imrmc::$(git ls-remote git://git.ennoruijters.nl/imrmc.git | grep '\srefs/heads/master$' | grep -o '^[0-9a-z]\+')"
cd DFTRES && echo "dftres=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "imrmc=$(git ls-remote git://git.ennoruijters.nl/imrmc.git | grep '\srefs/heads/master$' | grep -o '^[0-9a-z]\+')" >> $GITHUB_OUTPUT
- name: Cache DFTRES
id: cache-dftres
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: DFTRES/DFTRES.jar
key: ${{ runner.os }}-dftres-${{ steps.cache-revs.outputs.dftres }}
Expand All @@ -44,7 +45,7 @@ jobs:
run: cd DFTRES && make jar
- name: Cache IMRMC
id: cache-imrmc
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: imrmc/bin/imrmc
key: ${{ runner.os }}-imrmc-${{ steps.cache-revs.outputs.imrmc }}
Expand All @@ -59,7 +60,7 @@ jobs:
DFTRES: ${{github.workspace}}/DFTRES
run: cd test && bash test.sh --exact --imrmc
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: test-results
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: temurin
- name: Ready dependencies
run: |
curl https://www.ennoruijters.nl/package.gpg | sudo apt-key add -
Expand All @@ -18,7 +19,7 @@ jobs:
sudo apt-cache show storm | grep Version | sed -e 's/Version: /STORM_VERSION=/' >> $GITHUB_ENV
sudo mkdir apt-archive
- name: APT cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: apt-archive.tar
key: ${{ runner.os }}-apt-${{ env.STORM_VERSION }}
Expand All @@ -32,7 +33,7 @@ jobs:
- name: Compile DFTCalc
run: cd build && make -j4 install
- name: Checkout DFTRES
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: utwente-fmt/DFTRES
path: DFTRES
Expand All @@ -43,12 +44,12 @@ jobs:
- name: Get cache revisions
id: cache-revs
run: |
cd DFTRES && echo "::set-output name=dftres::$(git rev-parse HEAD)"
echo "::set-output name=imrmc::$(git ls-remote git://git.ennoruijters.nl/imrmc.git | grep '\srefs/heads/master$' | grep -o '^[0-9a-z]\+')"
echo "::set-output name=imrmc-march::$(gcc -march=native -E -v - </dev/null 2>&1 | grep cc1 | sha256sum | grep -o '^[0-9a-z]\+')"
cd DFTRES && echo "dftres=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "imrmc=$(git ls-remote git://git.ennoruijters.nl/imrmc.git | grep '\srefs/heads/master$' | grep -o '^[0-9a-z]\+')" >> $GITHUB_OUTPUT
echo "imrmc-march=$(gcc -march=native -E -v - </dev/null 2>&1 | grep cc1 | sha256sum | grep -o '^[0-9a-z]\+')" >> $GITHUB_OUTPUT
- name: Cache DFTRES
id: cache-dftres
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: DFTRES/DFTRES.jar
key: ${{ runner.os }}-dftres-${{ steps.cache-revs.outputs.dftres }}
Expand All @@ -57,7 +58,7 @@ jobs:
run: cd DFTRES && make jar
- name: Cache IMRMC
id: cache-imrmc
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: imrmc/bin/imrmc
key: ${{ runner.os }}-imrmc-${{ steps.cache-revs.outputs.imrmc }}-${{ steps.cache-revs.outputs.imrmc-march }}
Expand All @@ -72,7 +73,7 @@ jobs:
DFTRES: ${{github.workspace}}/DFTRES
run: cd test && bash test.sh --exact --imrmc && bash test.sh --exact --storm && bash test.sh --storm
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: test-results
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@ jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
path: dftcalc
- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: microsoft
- name: Checkout yaml-cpp
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: jbeder/yaml-cpp
path: yaml-cpp
- name: Checkout DFTRES
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: utwente-fmt/DFTRES
path: DFTRES
Expand All @@ -32,7 +33,7 @@ jobs:
echo "IMRMC_REV=$REV" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Try to load yaml-cpp
id: cache-yaml-cpp
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
yaml-cpp/yaml-cpp.dll
Expand All @@ -41,15 +42,15 @@ jobs:
- name: Compile yaml-cpp if not cached
if: steps.cache-yaml-cpp.outputs.cache-hit != 'true'
run: |
& "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\Launch-VsDevShell.ps1"
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1"
mkdir yaml-cpp/build | Out-Null
cd yaml-cpp/build
cmake -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DYAML_BUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release ..
ninja yaml-cpp.dll
copy yaml-cpp.dll,yaml-cpp.lib ..
- name: Cache DFTRES
id: cache-dftres
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: DFTRES\DFTRES.jar
key: ${{ runner.os }}-DFTRES-${{ env.DFTRES_REV }}
Expand All @@ -67,7 +68,7 @@ jobs:
java -jar DFTRES.jar --version
- name: Try to load win-flex and win-bison
id: cache-flex
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: win_flex_bison-2.5.23.zip
key: ${{ runner.os }}-flex-2.5.53
Expand All @@ -82,7 +83,7 @@ jobs:
"$Env:GITHUB_WORKSPACE\flex_bison" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Cache IMRMC
id: cache-imrmc
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: imrmc\imrmc.exe
key: ${{ runner.os }}-imrmc-${{ env.IMRMC_REV }}
Expand All @@ -92,12 +93,12 @@ jobs:
- name: Compile IMRMC
if: steps.cache-imrmc.outputs.cache-hit != 'true'
run: |
& "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\Launch-VsDevShell.ps1"
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1"
cd imrmc
nmake /F makefile.win imrmc.exe
- name: Build DFTCalc
run: |
& "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\Launch-VsDevShell.ps1"
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1"
mkdir dftcalc\build | Out-Null
cd dftcalc\build
cmake -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_PREFIX_PATH="$Env:GITHUB_WORKSPACE\yaml-cpp" -DCMAKE_INCLUDE_PATH="$Env:GITHUB_WORKSPACE\yaml-cpp" -DDFTROOT="$Env:GITHUB_WORKSPACE\dftcalc" ..
Expand All @@ -114,7 +115,7 @@ jobs:
cd dftcalc\test
.\test.ps1 --imrmc
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: dftcalc
Expand Down

0 comments on commit 470613b

Please sign in to comment.