-
Notifications
You must be signed in to change notification settings - Fork 61
upload artifacts #124
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
Merged
Merged
upload artifacts #124
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c319b87
upload artifacts
isaacbrodsky 878c202
fix upload running on windows
isaacbrodsky 769fed9
add download from github script
isaacbrodsky 155edf1
test with built artifacts
isaacbrodsky 4a0fa19
add GH_TOKEN env for actions
isaacbrodsky a1455c8
provide github ref override
isaacbrodsky 5d970ce
fix for windows
isaacbrodsky fa1bb06
fix for windows
isaacbrodsky 78229d9
fix ci ref
isaacbrodsky 39e626a
by run ID
isaacbrodsky e35b5eb
Use GH actions to download
isaacbrodsky fc65a0f
reenable jobs
isaacbrodsky b6c4f64
comment updates
isaacbrodsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,16 @@ jobs: | |
| - name: Format check for C | ||
| run: git diff --exit-code | ||
|
|
||
| - uses: actions/upload-artifact@v3 | ||
| name: Upload artifacts | ||
| if: ${{ matrix.java-version == 8 }} | ||
| with: | ||
| name: docker-built-shared-objects | ||
| path: | | ||
| src/main/resources/*/*.so | ||
| src/main/resources/*/*.dll | ||
| if-no-files-found: error | ||
|
|
||
| tests-new-dockcross: | ||
| name: Dockcross ${{ matrix.dockcross-tag }} Java ${{ matrix.java-version }} ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
|
|
@@ -54,7 +64,7 @@ jobs: | |
| os: [ubuntu-latest] | ||
| java-distribution: [adopt] | ||
| java-version: [17] | ||
| dockcross-tag: ["20220906-e88a3ce"] | ||
| dockcross-tag: ["20220906-e88a3ce", "20230116-670f7f7"] | ||
|
|
||
| steps: | ||
| - uses: actions/[email protected] | ||
|
|
@@ -109,6 +119,14 @@ jobs: | |
| - name: Tests | ||
| run: mvn -B -V clean test site | ||
|
|
||
| - uses: actions/upload-artifact@v3 | ||
| name: Upload Mac OS Artifacts | ||
| if: ${{ matrix.os == 'macos-latest' && matrix.java-version == 8 }} | ||
| with: | ||
| name: macos-built-shared-objects | ||
| path: src/main/resources/*/*.dylib | ||
| if-no-files-found: error | ||
|
|
||
| tests-coverage: | ||
| name: Java (Coverage) ${{ matrix.java-version }} ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
|
|
@@ -143,3 +161,52 @@ jobs: | |
| env: | ||
| CI_NAME: github | ||
| COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| tests-use-built-artifacts: | ||
| name: Java (Built Artifacts) ${{ matrix.java-version }} ${{ matrix.os }} | ||
| needs: | ||
| - tests | ||
| - tests-no-docker | ||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest] | ||
| java-distribution: [adopt] | ||
| java-version: [8] | ||
|
|
||
| steps: | ||
| - uses: actions/[email protected] | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - uses: actions/setup-java@v2 | ||
| with: | ||
| distribution: "${{ matrix.java-distribution }}" | ||
| java-version: "${{ matrix.java-version }}" | ||
|
|
||
| - uses: actions/cache@v2 | ||
| id: maven-cache | ||
| with: | ||
| path: ~/.m2/ | ||
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-maven- | ||
|
|
||
| - name: Download Docker binaries | ||
| uses: actions/download-artifact@v3 | ||
| with: | ||
| name: docker-built-shared-objects | ||
| path: src/main/resources/ | ||
|
|
||
| - name: Download Mac binaries | ||
| uses: actions/download-artifact@v3 | ||
| with: | ||
| name: macos-built-shared-objects | ||
| path: src/main/resources/ | ||
|
|
||
| - name: Download and test | ||
| run: | | ||
| mvn clean test -Dh3.github.artifacts.use=true -Dh3.github.artifacts.by_run=true | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ | |
| <groupId>com.uber</groupId> | ||
| <artifactId>h3</artifactId> | ||
| <packaging>jar</packaging> | ||
| <version>4.0.3-SNAPSHOT</version> | ||
| <version>4.1.0</version> | ||
| <name>h3</name> | ||
| <url>https://github.com/uber/h3-java</url> | ||
| <description>Java bindings for H3, a hierarchical hexagonal geospatial indexing system.</description> | ||
|
|
@@ -40,7 +40,7 @@ | |
| <connection>scm:git:git://github.com/uber/h3-java.git</connection> | ||
| <developerConnection>scm:git:ssh://[email protected]/uber/h3-java.git</developerConnection> | ||
| <url>http://github.com/uber/h3-java/tree/master</url> | ||
| <tag>HEAD</tag> | ||
| <tag>v4.1.0</tag> | ||
| </scm> | ||
|
|
||
| <developers> | ||
|
|
@@ -72,6 +72,8 @@ | |
| <h3.use.docker>true</h3.use.docker> | ||
| <h3.system.prune>false</h3.system.prune> | ||
| <h3.dockcross.tag>20210624-de7b1b0</h3.dockcross.tag> | ||
| <h3.github.artifacts.use>false</h3.github.artifacts.use> | ||
| <h3.github.artifacts.by_run /> | ||
| <!-- Used for passing additional arguments to surefire when using JaCoCo --> | ||
| <h3.additional.argLine /> | ||
|
|
||
|
|
@@ -112,7 +114,7 @@ | |
| <plugin> | ||
| <groupId>org.codehaus.mojo</groupId> | ||
| <artifactId>exec-maven-plugin</artifactId> | ||
| <version>1.1.1</version> | ||
| <version>3.1.0</version> | ||
| <executions> | ||
| <execution> | ||
| <!-- Override when building on Windows to use PowerShell & MSVC --> | ||
|
|
@@ -127,7 +129,7 @@ | |
| <argument>-ExecutionPolicy</argument> | ||
| <argument>Bypass</argument> | ||
| <argument>-File</argument> | ||
| <argument>${basedir}/src/main/c/h3-java/build-h3-windows.ps1</argument> | ||
| <argument>${project.basedir}/src/main/c/h3-java/build-h3-windows.ps1</argument> | ||
| <argument>${h3.git.remote}</argument> | ||
| <argument>${h3.git.reference}</argument> | ||
| </arguments> | ||
|
|
@@ -203,7 +205,7 @@ | |
| </goals> | ||
| <configuration> | ||
| <files> | ||
| <file>${basedir}/h3version.properties</file> | ||
| <file>${project.basedir}/h3version.properties</file> | ||
| </files> | ||
| </configuration> | ||
| </execution> | ||
|
|
@@ -223,7 +225,7 @@ | |
|
|
||
| <!-- Generate the native header file --> | ||
| <arg>-h</arg> | ||
| <arg>${basedir}/src/main/c/h3-java/src</arg> | ||
| <arg>${project.basedir}/src/main/c/h3-java/src</arg> | ||
| </compilerArgs> | ||
| </configuration> | ||
| </plugin> | ||
|
|
@@ -250,7 +252,7 @@ | |
| <plugin> | ||
| <groupId>org.codehaus.mojo</groupId> | ||
| <artifactId>exec-maven-plugin</artifactId> | ||
| <version>1.1.1</version> | ||
| <version>3.1.0</version> | ||
| <executions> | ||
| <execution> | ||
| <id>build-h3-c</id> | ||
|
|
@@ -261,13 +263,15 @@ | |
| <goal>exec</goal> | ||
| </goals> | ||
| <configuration> | ||
| <executable>${basedir}/src/main/c/h3-java/build-h3.sh</executable> | ||
| <executable>${project.basedir}/src/main/c/h3-java/build-h3.sh</executable> | ||
| <arguments> | ||
| <argument>${h3.git.remote}</argument> | ||
| <argument>${h3.git.reference}</argument> | ||
| <argument>${h3.use.docker}</argument> | ||
| <argument>${h3.system.prune}</argument> | ||
| <argument>${h3.dockcross.tag}</argument> | ||
| <argument>${h3.github.artifacts.use}</argument> | ||
| <argument>${h3.github.artifacts.by_run}</argument> | ||
| </arguments> | ||
| </configuration> | ||
| </execution> | ||
|
|
@@ -288,7 +292,7 @@ | |
| <outputDirectory>${project.build.outputDirectory}</outputDirectory> | ||
| <resources> | ||
| <resource> | ||
| <directory>${basedir}/src/main/resources</directory> | ||
| <directory>${project.basedir}/src/main/resources</directory> | ||
| <filtering>false</filtering> | ||
| </resource> | ||
| </resources> | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Copyright 2023 Uber Technologies, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| # Retrieves built artifacts from Github. The purpose of this script is | ||
| # to enable deployment from any system, regardless of whether it can | ||
| # run the particular cross compiling steps needed to build native shared | ||
| # objects. Some of the native shared objects require particular Docker | ||
| # setups, or indeed running on Mac OS, which is difficult to maintain. | ||
| # | ||
| # You must install the Github CLI and authenticate with a personal access | ||
| # token (classic) with workflows scope to use this. https://cli.github.com/ | ||
| # This script also requires `jq`. | ||
| # | ||
| # This script expects to be run from the project's base directory (where | ||
| # pom.xml is) as part of the Maven build process. | ||
|
|
||
| set -eox pipefail | ||
|
|
||
| GITHUB_ARTIFACTS_RUN=$1 | ||
|
|
||
| EXTRACT_TO=src/main/resources | ||
|
|
||
| if [ -z "$GITHUB_ARTIFACTS_RUN" ]; then | ||
| mkdir -p target | ||
| pushd target | ||
|
|
||
| ARTIFACTS_LIST=$(gh api \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| /repos/{owner}/{repo}/actions/artifacts) | ||
|
|
||
| echo "downloading artifacts for run $GITHUB_ARTIFACTS_RUN" | ||
| TO_DOWNLOAD=$(echo "$ARTIFACTS_LIST" \ | ||
| | jq ".artifacts[] | select(.workflow_run.id == \"$GITHUB_ARTIFACTS_RUN\")") | ||
|
|
||
| echo $TO_DOWNLOAD | jq -c '.' | while read artifactline; do | ||
| ARTIFACT_NAME=$(echo $artifactline | jq -r .name) | ||
| ARTIFACT_ID=$(echo $artifactline | jq .id) | ||
| echo "Downloading $ARTIFACT_NAME: $ARTIFACT_ID" | ||
| gh api "/repos/{owner}/{repo}/actions/artifacts/$ARTIFACT_ID/zip" > "$ARTIFACT_NAME.zip" | ||
| unzip -o "$ARTIFACT_NAME.zip" -d "../$EXTRACT_TO" | ||
| done | ||
|
|
||
| popd | ||
| fi | ||
|
|
||
| echo Checking that expected images are present: | ||
|
|
||
| for image in android-arm android-arm64 linux-arm64 linux-armv5 linux-armv7 linux-s390x \ | ||
| linux-ppc64le linux-x64 linux-x86; do | ||
| if [ -f "$EXTRACT_TO/$image/libh3-java.so" ]; then | ||
| echo "$image" exists | ||
| else | ||
| echo "$image" missing! | ||
| exit 1 | ||
| fi | ||
| done | ||
|
|
||
| for image in darwin-x64 darwin-arm64; do | ||
| if [ -f "$EXTRACT_TO/$image/libh3-java.dylib" ]; then | ||
| echo "$image" exists | ||
| else | ||
| echo "$image" missing! | ||
| exit 1 | ||
| fi | ||
| done | ||
|
|
||
| for image in windows-x64 windows-x86; do | ||
| if [ -f "$EXTRACT_TO/$image/libh3-java.dll" ]; then | ||
| echo "$image" exists | ||
| else | ||
| echo "$image" missing! | ||
| exit 1 | ||
| fi | ||
| done | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.