Skip to content

Commit

Permalink
pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Aug 29, 2024
1 parent d95051f commit fe2c5a6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ env:
DFX_VERSION: 0.21.0
NODE_VERSION: 20
jobs:
get-all-test-dirs:
get-tests:
if: ${{ contains(github.head_ref, 'release--') }}
name: Get all test dirs
name: Get tests
runs-on: ubuntu-latest
outputs:
all_tests: ${{ steps.get_all_tests.outputs.all_tests }}
tests: ${{ steps.get_tests.outputs.tests }}
steps:
- uses: actions/checkout@v4
- name: Get all test dirs
id: get_all_tests
id: get_tests
uses: ./.github/actions/generate_tests
with:
directories: |
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
# Only run this job if it's a release branch. This job will run instead of run-tests and will automatically publish another commit which will be tested
if: ${{ !needs.determine-is-manual-release.outputs.is_manual_release }}
needs:
- get-all-test-dirs
- get-tests
- determine-is-manual-release
runs-on: ubuntu-latest
env:
Expand All @@ -67,16 +67,19 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref || github.ref }}
token: ${{ secrets.LASTMJS_GITHUB_TOKEN || github.token }}

- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Install dfx
run: |
DFXVM_INIT_YES=true DFX_VERSION=${{ env.DFX_VERSION }} sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
echo "$HOME/.local/share/dfx/bin" >> $GITHUB_PATH
# TODO we should use some Action-specific bot account
- name: Configure git for publishing release
run: |
Expand All @@ -85,5 +88,6 @@ jobs:
git config --global commit.gpgsign true
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
git config --global user.signingkey C8B77BCBE16CD2B94B43F9C8757397B82D4ED7B0
- name: Publish release
run: ./.github/scripts/publish_github_action.sh $RELEASE_VERSION ${{ toJSON(needs.get-all-test-dirs.outputs.all_tests).*.path }}
run: ./.github/scripts/publish_github_action.sh $RELEASE_VERSION ${{ toJSON(needs.get-tests.outputs.tests).*.path }}
16 changes: 9 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ env:
DFX_VERSION: 0.21.0
NODE_VERSION: 20
jobs:
generate-tests:
name: Generate tests
get-tests:
name: Get tests
runs-on: ubuntu-latest
outputs:
all_tests: ${{ steps.get_all_tests.outputs.all_tests }}
tests: ${{ steps.get_tests.outputs.tests }}
steps:
- uses: actions/checkout@v4
- name: Generate tests
id: get_all_tests

- name: Get tests
id: get_tests
uses: ./.github/actions/generate_tests
with:
directories: |
Expand All @@ -50,6 +51,7 @@ jobs:
should_run_tests: ${{ steps.determine_should_run_tests.outputs.should_run_tests }}
steps:
- uses: actions/checkout@v4

- id: determine_should_run_tests
# Determine if tests should run for this pr. If it's a manually submitted release candidate no tests will run.
run: |
Expand All @@ -76,7 +78,7 @@ jobs:
name: '${{matrix.tests.name}} | ${{matrix.tests.type}} | ${{matrix.tests.syntax}} | ${{matrix.tests.api}} | ${{matrix.azle_source}}'
needs:
- determine-should-run-tests
- generate-tests
- get-tests
if: ${{ needs.determine-should-run-tests.outputs.should_run_tests }}
runs-on: ${{ matrix.os }}
env:
Expand All @@ -101,7 +103,7 @@ jobs:
- include_npm: true
azle_source: repo
# If should_run_tests is false, we still want the steps of this job to execute so that check-run-test-success will run. We do this by creating an array with one dummy element
tests: ${{ needs.determine-should-run-tests.outputs.should_run_tests == 'true' && fromJSON(needs.generate-tests.outputs.all_tests) || fromJSON('["dummy"]') }}
tests: ${{ needs.determine-should-run-tests.outputs.should_run_tests == 'true' && fromJSON(needs.get-tests.outputs.tests) || fromJSON('["dummy"]') }}
steps:
- name: Report full path of test
run: echo ${{matrix.tests.path}}
Expand Down

0 comments on commit fe2c5a6

Please sign in to comment.