From 36865a33340c3b103501035665cc4fa34afedf5d Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Tue, 6 Aug 2024 10:15:11 -0600 Subject: [PATCH 1/8] implement gha-dart-oss --- .github/workflows/ci.yaml | 26 ++++++++------------------ .github/workflows/publish.yaml | 0 2 files changed, 8 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 85f2cd73..0e494216 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,26 +13,16 @@ permissions: jobs: checks: + uses: Workiva/gha-dart-oss/.github/workflows/checks.yaml@v0.1.0 + + sbom: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dart-lang/setup-dart@v1 with: sdk: 2.19.6 - - - run: dart pub get - - - name: Analyze - run: dart run dart_dev analyze - - - name: Format - run: dart run dart_dev format --check - - - name: Validate Dependencies - run: dart run dependency_validator - - - name: Generate SBOM - uses: anchore/sbom-action@v0 + - uses: anchore/sbom-action@v0 with: path: ./ format: cyclonedx-json @@ -40,7 +30,7 @@ jobs: snapshots: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install scip cli run: | bash -c 'curl -L "https://github.com/sourcegraph/scip/releases/download/v0.3.3/scip-linux-amd64.tar.gz"' | tar xzf - scip @@ -100,9 +90,9 @@ jobs: - run: dart pub get # Setup repo to run on - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: - repo: ${{ matrix.repo }} + repository: ${{ matrix.repo }} path: ${{ matrix.repo }} - run: dart pub get working-directory: ${{ matrix.repo }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 00000000..e69de29b From 47f099914d92778e9196d610030ca362229c7759 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Tue, 6 Aug 2024 10:19:38 -0600 Subject: [PATCH 2/8] fixed consumer tests --- .github/workflows/ci.yaml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0e494216..eee5f30c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -74,11 +74,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - repo: [ - "Workiva/over_react", - "Workiva/w_module", - "rrousselGit/provider", - "dart-lang/args", + consumer: [ + { repo: "Workiva/over_react", ref: "master"}, + { repo: "Workiva/w_module", ref: "master"}, + { repo: "rrousselGit/provider", ref: "master"}, + { repo: "dart-lang/args", ref: "v2.4.2" } # master requires dart 3 ] steps: @@ -92,10 +92,11 @@ jobs: # Setup repo to run on - uses: actions/checkout@v4 with: - repository: ${{ matrix.repo }} - path: ${{ matrix.repo }} + repository: ${{ matrix.consumer.repo }} + path: ${{ matrix.consumer.repo }} + ref: ${{ matrix.consumer.ref }} - run: dart pub get - working-directory: ${{ matrix.repo }} + working-directory: ${{ matrix.consumer.repo }} - run: | - dart run scip_dart ./${{ matrix.repo }} || exit 1 + dart run scip_dart ./${{ matrix.consumer.repo }} || exit 1 From fb4548c8d13fcc6b44c90d4ee4d94078c8ae59d1 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Tue, 6 Aug 2024 10:27:25 -0600 Subject: [PATCH 3/8] implemented gha-dart-oss --- .github/workflows/publish.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e69de29b..972a5ea2 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -0,0 +1,16 @@ +name: Publish + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +permissions: + contents: write + id-token: write + pull-requests: write + +jobs: + # Generates and uploads sbom, and publishes to pub.dev + publish: + uses: Workiva/gha-dart-oss/.github/workflows/publish.yaml@v0.1.0 \ No newline at end of file From 001471092d3230ac49946cc085bb6dd78e09ea6d Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Tue, 6 Aug 2024 10:31:05 -0600 Subject: [PATCH 4/8] updated --- .github/workflows/ci.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index eee5f30c..ffa0bfde 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -73,11 +73,12 @@ jobs: consumer: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: consumer: [ - { repo: "Workiva/over_react", ref: "master"}, - { repo: "Workiva/w_module", ref: "master"}, - { repo: "rrousselGit/provider", ref: "master"}, + { repo: "Workiva/over_react" }, + { repo: "Workiva/w_module" }, + { repo: "rrousselGit/provider", packagePath: "/provider/packages/provider" }, { repo: "dart-lang/args", ref: "v2.4.2" } # master requires dart 3 ] @@ -93,10 +94,10 @@ jobs: - uses: actions/checkout@v4 with: repository: ${{ matrix.consumer.repo }} - path: ${{ matrix.consumer.repo }} - ref: ${{ matrix.consumer.ref }} + path: ${{ matrix.consumer.repo}} + ref: ${{ matrix.consumer.ref || 'master' }} - run: dart pub get working-directory: ${{ matrix.consumer.repo }} - run: | - dart run scip_dart ./${{ matrix.consumer.repo }} || exit 1 + dart run scip_dart ./${{ matrix.consumer.repo }}${{ matrix.consumer.packagePath || '' }} || exit 1 From 08ed4eccf03c1eed5fded0c6e68f092aff8329f2 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Tue, 6 Aug 2024 10:31:49 -0600 Subject: [PATCH 5/8] updated incorrect url --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ffa0bfde..6a17155a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -78,7 +78,7 @@ jobs: consumer: [ { repo: "Workiva/over_react" }, { repo: "Workiva/w_module" }, - { repo: "rrousselGit/provider", packagePath: "/provider/packages/provider" }, + { repo: "rrousselGit/provider", packagePath: "/packages/provider" }, { repo: "dart-lang/args", ref: "v2.4.2" } # master requires dart 3 ] From 1cc563ea6e0068db9f3b95dc01960a3242f791de Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Tue, 6 Aug 2024 10:33:06 -0600 Subject: [PATCH 6/8] with pub get --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6a17155a..23a8eb16 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -88,7 +88,8 @@ jobs: - uses: dart-lang/setup-dart@v1 with: sdk: 2.19.6 - - run: dart pub get + - working-directory: ${{ matrix.consumer.packagePath || './' }} + run: dart pub get # Setup repo to run on - uses: actions/checkout@v4 From ac48deef21eadb14864952ecd08a2eaf6c85e32d Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Tue, 6 Aug 2024 10:34:37 -0600 Subject: [PATCH 7/8] wrong pub-get --- .github/workflows/ci.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 23a8eb16..91f2c498 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -88,8 +88,7 @@ jobs: - uses: dart-lang/setup-dart@v1 with: sdk: 2.19.6 - - working-directory: ${{ matrix.consumer.packagePath || './' }} - run: dart pub get + - run: dart pub get # Setup repo to run on - uses: actions/checkout@v4 @@ -98,7 +97,7 @@ jobs: path: ${{ matrix.consumer.repo}} ref: ${{ matrix.consumer.ref || 'master' }} - run: dart pub get - working-directory: ${{ matrix.consumer.repo }} + working-directory: ${{ matrix.consumer.repo }}${{ matrix.consumer.packagePath || '' }} - run: | dart run scip_dart ./${{ matrix.consumer.repo }}${{ matrix.consumer.packagePath || '' }} || exit 1 From 867096f48d2855ab14638dc8c34c4c1cd82aaf1d Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Tue, 6 Aug 2024 10:36:29 -0600 Subject: [PATCH 8/8] removed flutter only package --- .github/workflows/ci.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 91f2c498..ebb42c75 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -78,7 +78,6 @@ jobs: consumer: [ { repo: "Workiva/over_react" }, { repo: "Workiva/w_module" }, - { repo: "rrousselGit/provider", packagePath: "/packages/provider" }, { repo: "dart-lang/args", ref: "v2.4.2" } # master requires dart 3 ] @@ -97,7 +96,7 @@ jobs: path: ${{ matrix.consumer.repo}} ref: ${{ matrix.consumer.ref || 'master' }} - run: dart pub get - working-directory: ${{ matrix.consumer.repo }}${{ matrix.consumer.packagePath || '' }} + working-directory: ${{ matrix.consumer.repo }} - run: | - dart run scip_dart ./${{ matrix.consumer.repo }}${{ matrix.consumer.packagePath || '' }} || exit 1 + dart run scip_dart ./${{ matrix.consumer.repo }} || exit 1