Skip to content

Commit

Permalink
ci: update ci workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku committed Mar 7, 2024
1 parent aaeded2 commit 9d9a803
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 68 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

# `dist/index.js` is a special file in Actions.
# When you reference an action with `uses:` in a workflow,
# `index.js` is the code that will run.
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
Expand Down
50 changes: 11 additions & 39 deletions .github/workflows/development-freeze.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

name: Development Freeze

on:
Expand All @@ -8,10 +6,6 @@ on:
types:
- completed

env:
PULL_REQUEST_METADATA_DIR: pull_request
PULL_REQUEST_METADATA_FILE: metadata

permissions:
contents: read

Expand All @@ -23,50 +17,28 @@ jobs:
runs-on: ubuntu-latest

permissions:
issues: write
# Needed for commenting on Pull Requests
pull-requests: write

steps:
- name: Download Pull Request Metadata artifact
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "${{ env.PULL_REQUEST_METADATA_FILE }}"
})[0];
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
const fs = require('fs');
fs.writeFileSync('${{ github.workspace }}/${{ env.PULL_REQUEST_METADATA_FILE }}.zip', Buffer.from(download.data));
- run: unzip ${{ env.PULL_REQUEST_METADATA_FILE }}.zip

- name: 'Get Pull Request number'
uses: actions/github-script@v6
- id: Artifact
name: Download Pull Request Metadata artifact
uses: redhat-plumbers-in-action/download-artifact@v1
with:
script: |
const fs = require('fs');
const pr_number = Number(fs.readFileSync('./${{ env.PULL_REQUEST_METADATA_FILE }}'));
core.exportVariable('pr_number', pr_number);
github-token: ${{ secrets.GITHUB_TOKEN }}
name: Pull Request Metadata

- name: Repository checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Development Freezer
uses: redhat-plumbers-in-action/devel-freezer@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Development Freezer
uses: ./
with:
pr-number: ${{ env.pr_number }}
pr-number: ${{ fromJSON(steps.Artifact.outputs.pr-metadata-json).number }}
token: ${{ secrets.GITHUB_TOKEN }}

...
4 changes: 0 additions & 4 deletions .github/workflows/gather-pr-metadata.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

name: Gather Pull Request Metadata

on:
Expand Down Expand Up @@ -34,5 +32,3 @@ jobs:
name: ${{ env.PULL_REQUEST_METADATA_FILE }}
path: ${{ env.PULL_REQUEST_METADATA_DIR }}
retention-days: 1

...
2 changes: 0 additions & 2 deletions .github/workflows/issue-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

name: Issue labeler
on:
issues:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

name: Linting suite

on:
Expand Down Expand Up @@ -37,6 +35,3 @@ jobs:

- name: ESLint
run: yarn run lint

# - name: Run CSpell
# run: yarn run lint:spellcheck
2 changes: 0 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

name: GitHub Tag Update

on:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

name: Release Drafter

on:
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

name: Unit tests

on:
Expand All @@ -17,17 +15,13 @@ jobs:
name: Unit Tests - Node.js
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 18.x, 20.x ]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: 20
cache: yarn
cache-dependency-path: yarn.lock

Expand All @@ -44,5 +38,6 @@ jobs:
run: yarn test

- name: Codecov
if: ${{ matrix.node-version == '20.x' }}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 9d9a803

Please sign in to comment.