-
Notifications
You must be signed in to change notification settings - Fork 42
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
chore: ci: standardize #217
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
name: "check and build" | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
tests: | ||
uses: ./.github/workflows/wf_check.yaml | ||
with: | ||
NAME: hasura-storage | ||
GIT_REF: ${{ github.event.pull_request.head.sha }} | ||
|
||
build_artifacts: | ||
uses: ./.github/workflows/wf_build_artifacts.yaml | ||
with: | ||
NAME: hasura-storage | ||
VERSION: 0.0.0-dev # hardcoded to avoid rebuilding | ||
DOCKER: true | ||
GIT_REF: ${{ github.event.pull_request.head.sha }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
.github/workflows/push_main.yaml → .github/workflows/release_drafter.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
name: "main: Release drafter" | ||
name: "Release drafter" | ||
on: | ||
push: | ||
branches: | ||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
--- | ||
on: | ||
workflow_call: | ||
inputs: | ||
NAME: | ||
type: string | ||
required: true | ||
GIT_REF: | ||
type: string | ||
required: false | ||
VERSION: | ||
type: string | ||
required: true | ||
PATH: | ||
type: string | ||
default: "." | ||
required: false | ||
DOCKER: | ||
type: boolean | ||
required: true | ||
|
||
jobs: | ||
artifacts: | ||
# These permissions are needed to interact with GitHub's OIDC Token endpoint. | ||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04, ubuntu-arm64-22.04-2cores] | ||
fail-fast: true | ||
|
||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 180 | ||
|
||
steps: | ||
- name: "Check out repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ inputs.GIT_REF }} | ||
|
||
- uses: cachix/install-nix-action@v27 | ||
with: | ||
install_url: "https://releases.nixos.org/nix/nix-2.22.3/install" | ||
install_options: "--no-daemon" | ||
extra_nix_config: | | ||
experimental-features = nix-command flakes | ||
sandbox = false | ||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | ||
substituters = https://cache.nixos.org/?priority=40 | ||
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= | ||
|
||
- uses: DeterminateSystems/magic-nix-cache-action@v7 | ||
with: | ||
diagnostic-endpoint: "" | ||
use-flakehub: false | ||
|
||
- name: "Verify if we need to build" | ||
id: verify-build | ||
run: | | ||
export drvPath=$(make check-dry-run) | ||
echo "drvPath - $drvPath" | ||
nix store verify --no-trust --store http://127.0.0.1:37515 $drvPath \ | ||
&& export BUILD_NEEDED=no \ | ||
|| export BUILD_NEEDED=yes | ||
|
||
echo BUILD_NEEDED=$BUILD_NEEDED >> $GITHUB_OUTPUT | ||
echo DERIVATION_PATH=$drvPath >> $GITHUB_OUTPUT | ||
|
||
- name: Compute common env vars | ||
id: vars | ||
run: | | ||
echo "VERSION=$(make get-version VER=${{ inputs.VERSION }})" >> $GITHUB_OUTPUT | ||
|
||
- name: "Build artifact" | ||
run: | | ||
make build | ||
zip -r result.zip result | ||
|
||
- name: "Push artifact to artifact repository" | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.NAME }}-artifact-${{ matrix.os }}-${{ steps.vars.outputs.VERSION }} | ||
path: result/bin/hasura-storage | ||
retention-days: 7 | ||
|
||
- name: "Build docker image" | ||
run: | | ||
make build-docker-image | ||
if: ${{ ( inputs.DOCKER ) }} | ||
|
||
- name: "Push docker image to artifact repository" | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.NAME }}-docker-image-${{ matrix.os }}-${{ steps.vars.outputs.VERSION }} | ||
path: result | ||
retention-days: 7 | ||
if: ${{ ( inputs.DOCKER ) }} | ||
|
||
# - name: "Cache build environment" | ||
# run: | | ||
# # DEPENDENCIES=($(nix-store --query --requisites --include-outputs ${{ steps.verify-build.outputs.DERIVATION_PATH }})) | ||
# nix copy --to http://127.0.0.1:37515 "${DEPENDENCIES[@]}" || exit 0 | ||
# if: ${{ steps.verify-build.outputs.BUILD_NEEDED == 'yes' }} | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this step commented ?