diff --git a/.github/workflows/AppFwkUnitTest.yml b/.github/workflows/AppFwkUnitTest.yml index 8e424cd76b..36ff22f754 100644 --- a/.github/workflows/AppFwkUnitTest.yml +++ b/.github/workflows/AppFwkUnitTest.yml @@ -12,6 +12,15 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Set apt mirror + # see https://github.com/actions/runner-images/issues/7048 + if: "contains( matrix.os, 'ubuntu')" + run: | + # make sure there is a `\t` between URL and `priority:*` attributes + printf 'http://azure.archive.ubuntu.com/ubuntu priority:1\n' | sudo tee /etc/apt/mirrors.txt + curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt + sudo sed -i 's/http:\/\/azure.archive.ubuntu.com\/ubuntu\//mirror+file:\/etc\/apt\/mirrors.txt/' /etc/apt/sources.list + - name: Install Linux dependencies if: "contains( matrix.os, 'ubuntu')" run: | diff --git a/.github/workflows/ResInsightWithCache.yml b/.github/workflows/ResInsightWithCache.yml index 5f4027e97f..0447780530 100644 --- a/.github/workflows/ResInsightWithCache.yml +++ b/.github/workflows/ResInsightWithCache.yml @@ -132,6 +132,15 @@ jobs: run: echo "${{github.workspace}}/buildcache/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 shell: pwsh + - name: Set apt mirror + # see https://github.com/actions/runner-images/issues/7048 + if: "contains( matrix.config.os, 'ubuntu')" + run: | + # make sure there is a `\t` between URL and `priority:*` attributes + printf 'http://azure.archive.ubuntu.com/ubuntu priority:1\n' | sudo tee /etc/apt/mirrors.txt + curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt + sudo sed -i 's/http:\/\/azure.archive.ubuntu.com\/ubuntu\//mirror+file:\/etc\/apt\/mirrors.txt/' /etc/apt/sources.list + - name: Install Linux dependencies if: "contains( matrix.config.os, 'ubuntu')" run: | diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index badd3b00f7..f40f115574 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -6,25 +6,34 @@ jobs: clang-format-job: runs-on: ubuntu-20.04 steps: + - name: Set apt mirror + # GitHub Actions apt proxy is super unstable + # see https://github.com/actions/runner-images/issues/7048 + run: | + # make sure there is a `\t` between URL and `priority:*` attributes + printf 'http://azure.archive.ubuntu.com/ubuntu priority:1\n' | sudo tee /etc/apt/mirrors.txt + curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt + sudo sed -i 's/http:\/\/azure.archive.ubuntu.com\/ubuntu\//mirror+file:\/etc\/apt\/mirrors.txt/' /etc/apt/sources.list + - name: Install clang-format 10.0 run: | - sudo apt install --option="APT::Acquire::Retries=3" clang-format - clang-format --version + sudo apt-get install --option="APT::Acquire::Retries=3" clang-format-10 + clang-format-10 --version - uses: actions/checkout@v3 - name: Check format - ApplicationLibCode run: | cd ApplicationLibCode - find -name *.h -o -name *.cpp -o -name *.inl | xargs clang-format -i + find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | xargs clang-format-10 -i git diff - name: Check format - ApplicationExeCode run: | cd ApplicationExeCode - find -name *.h -o -name *.cpp -o -name *.inl | xargs clang-format -i + find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | xargs clang-format-10 -i git diff - name: Check format - AppFwk run: | cd Fwk/AppFwk - find -name *.h -o -name *.cpp -o -name *.inl | grep -v gtest | xargs clang-format -i + find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | grep -v gtest | xargs clang-format-10 -i git diff - uses: peter-evans/create-pull-request@v4 with: diff --git a/ApplicationLibCode/Application/RiaThermalFractureDefines.h b/ApplicationLibCode/Application/RiaThermalFractureDefines.h index 619fbf84d7..59947419de 100644 --- a/ApplicationLibCode/Application/RiaThermalFractureDefines.h +++ b/ApplicationLibCode/Application/RiaThermalFractureDefines.h @@ -22,8 +22,6 @@ #include - - namespace RiaDefines { QString leakoffPressureDropResultName(); diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicMswSegmentCellIntersection.h b/ApplicationLibCode/Commands/CompletionExportCommands/RicMswSegmentCellIntersection.h index b661873597..5276ba96d6 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicMswSegmentCellIntersection.h +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicMswSegmentCellIntersection.h @@ -30,9 +30,9 @@ class RicMswSegmentCellIntersection { public: RicMswSegmentCellIntersection( const QString& gridName, // Pass in empty string for main grid - size_t globalCellIndex, - const cvf::Vec3st& gridLocalCellIJK, - const cvf::Vec3d& lengthsInCell ); + size_t globalCellIndex, + const cvf::Vec3st& gridLocalCellIJK, + const cvf::Vec3d& lengthsInCell ); const QString& gridName() const; size_t globalCellIndex() const; cvf::Vec3st gridLocalCellIJK() const; diff --git a/ApplicationLibCode/Commands/ExportCommands/RicExportLgrFeature.h b/ApplicationLibCode/Commands/ExportCommands/RicExportLgrFeature.h index d8fce674e5..8ec574a38c 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicExportLgrFeature.h +++ b/ApplicationLibCode/Commands/ExportCommands/RicExportLgrFeature.h @@ -117,10 +117,11 @@ public: int priority() const { - return type == RigCompletionData::CompletionType::FRACTURE ? 1 - : type == RigCompletionData::CompletionType::FISHBONES ? 2 - : type == RigCompletionData::CompletionType::PERFORATION ? 3 - : 4; + return type == RigCompletionData::CompletionType::FRACTURE + ? 1 + : type == RigCompletionData::CompletionType::FISHBONES + ? 2 + : type == RigCompletionData::CompletionType::PERFORATION ? 3 : 4; } // Sort by priority, then name, then number diff --git a/ApplicationLibCode/FileInterface/RifSurfaceImporter.h b/ApplicationLibCode/FileInterface/RifSurfaceImporter.h index d9187e564b..bc166c2d68 100644 --- a/ApplicationLibCode/FileInterface/RifSurfaceImporter.h +++ b/ApplicationLibCode/FileInterface/RifSurfaceImporter.h @@ -23,7 +23,6 @@ #include #include #include -#include #include diff --git a/ApplicationLibCode/ProjectDataModel/Annotations/RimReachCircleAnnotation.h b/ApplicationLibCode/ProjectDataModel/Annotations/RimReachCircleAnnotation.h index 6b10739e11..edc14ebf4c 100644 --- a/ApplicationLibCode/ProjectDataModel/Annotations/RimReachCircleAnnotation.h +++ b/ApplicationLibCode/ProjectDataModel/Annotations/RimReachCircleAnnotation.h @@ -71,7 +71,7 @@ protected: void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; caf::PdmFieldHandle* userDescriptionField() override; caf::PdmFieldHandle* objectToggleField() override; - void defineEditorAttribute( const caf::PdmFieldHandle* field, + void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; diff --git a/ApplicationLibCode/ProjectDataModel/Intersections/RimIntersectionResultsDefinitionCollection.h b/ApplicationLibCode/ProjectDataModel/Intersections/RimIntersectionResultsDefinitionCollection.h index 6b2b0fab72..5b7fed4f7d 100644 --- a/ApplicationLibCode/ProjectDataModel/Intersections/RimIntersectionResultsDefinitionCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Intersections/RimIntersectionResultsDefinitionCollection.h @@ -43,7 +43,7 @@ public: protected: caf::PdmFieldHandle* objectToggleField() override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; - void initAfterRead() override; + void initAfterRead() override; private: caf::PdmField m_isActive; diff --git a/ApplicationLibCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h b/ApplicationLibCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h index 4ec869c9bf..a0e3ddd096 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h +++ b/ApplicationLibCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h @@ -62,9 +62,9 @@ inline Opm::FlowDiagnostics::ConnectionValues { using ConnVals = Opm::FlowDiagnostics::ConnectionValues; - auto flux = ConnVals( ConnVals::NumConnections{G.numConnections()}, ConnVals::NumPhases{actPh.size()} ); + auto flux = ConnVals( ConnVals::NumConnections{ G.numConnections() }, ConnVals::NumPhases{ actPh.size() } ); - auto phas = ConnVals::PhaseID{0}; + auto phas = ConnVals::PhaseID{ 0 }; for ( const auto& p : actPh ) { @@ -74,7 +74,7 @@ inline Opm::FlowDiagnostics::ConnectionValues { assert( pflux.size() == flux.numConnections() ); - auto conn = ConnVals::ConnID{0}; + auto conn = ConnVals::ConnID{ 0 }; for ( const auto& v : pflux ) { flux( conn, phas ) = v; diff --git a/ApplicationLibCode/UserInterface/AnalysisPlots/RiuGroupedBarChartBuilder.h b/ApplicationLibCode/UserInterface/AnalysisPlots/RiuGroupedBarChartBuilder.h index aef1a82714..2455331eb6 100644 --- a/ApplicationLibCode/UserInterface/AnalysisPlots/RiuGroupedBarChartBuilder.h +++ b/ApplicationLibCode/UserInterface/AnalysisPlots/RiuGroupedBarChartBuilder.h @@ -22,9 +22,9 @@ #include #include +#include #include #include -#include class QwtPlot; class QColor;