-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Omegapoint/feature/TestUploadTesting
Feature/test upload testing
- Loading branch information
Showing
3 changed files
with
90 additions
and
73 deletions.
There are no files selected for viewing
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,63 +1,9 @@ | ||
name: Creating Release | ||
|
||
name: Creating release | ||
run-name: ${{ github.actor }} creating a release | ||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
release: | ||
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies and build | ||
run: npm ci && npm run build | ||
|
||
- name: 'Get latest release tag' | ||
id: latest_release | ||
run: | | ||
current_version=`gh release list --limit 30 | grep Latest | awk '{ print $1;}'` | ||
if [ -z "$current_version" ] | ||
then | ||
echo "No release found" | ||
echo "Creating tag for firt release" | ||
echo "version=v1.0.0" >> $GITHUB_ENV | ||
else | ||
echo "version=${current_version}" >> $GITHUB_ENV | ||
fi | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
- name: Display version | ||
run: | | ||
# Display the version from the environment | ||
echo "Latest Version: ${{ env.version }}" | ||
- id: label | ||
uses: zwaldowski/match-label-action@v4 | ||
with: | ||
allowed: major,minor,patch | ||
default_match: none | ||
|
||
- uses: actions-ecosystem/action-bump-semver@v1 | ||
if: ${{ steps.label.outputs.match != 'none' }} | ||
id: bump-semver | ||
with: | ||
current_version: ${{ env.version }} | ||
level: ${{steps.label.outputs.match}} | ||
|
||
- name: 'Creating Release' | ||
if: ${{ steps.label.outputs.match != 'none' }} | ||
run: | | ||
gh release create ${{ steps.bump-semver.outputs.new_version }} --title " ${{ steps.bump-semver.outputs.new_version }}" --generate-notes | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
- uses: JasonEtco/build-and-tag-action@v2 | ||
if: ${{ steps.label.outputs.match != 'none' }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
tag_name: ${{ steps.bump-semver.outputs.new_version }} | ||
call-release-workflow: | ||
uses: omegapoint/cydig-reusable-workflows/.github/workflows/release.yml@main |
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,22 +1,94 @@ | ||
name: Test | ||
name: Test all actions | ||
run-name: ${{ github.actor }} is running tests | ||
permissions: | ||
contents: write | ||
pages: write | ||
contents: read | ||
pages: read | ||
id-token: write | ||
|
||
on: [push] | ||
on: [pull_request] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout action | ||
uses: actions/checkout@v3 | ||
- name: Checkout Upload action | ||
uses: actions/checkout@v4 | ||
with: | ||
path: upload-action | ||
- name: Checkout Azure compliance action | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: Omegapoint/cydig-azure-compliance-action | ||
path: azure-compliance-action | ||
- name: Checkout compliance action | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: Omegapoint/cydig-compliance-action | ||
path: compliance-action | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run tests | ||
run: npm run test | ||
- name: Compile to Javascript | ||
run: npm run build | ||
|
||
- name: Install upload action dependencies | ||
run: | | ||
cd upload-action | ||
npm ci | ||
- name: Install compliance action dependencies | ||
run: | | ||
cd compliance-action | ||
npm ci | ||
- name: Install azure compliance action dependencies | ||
run: | | ||
cd azure-compliance-action | ||
npm ci | ||
- name: Run upload tests | ||
run: | | ||
cd upload-action | ||
npm run test | ||
- name: Run azure compliance tests | ||
run : | | ||
cd azure-compliance-action | ||
npm run test | ||
- name: Run compliance tests | ||
run : | | ||
cd compliance-action | ||
npm run test | ||
- name: Build Upload action | ||
run: | | ||
cd upload-action | ||
npm run build | ||
- name: Build azure compliance action | ||
run: | | ||
cd azure-compliance-action | ||
npm run build | ||
- name: Build compliance action | ||
run: | | ||
cd compliance-action | ||
npm run build | ||
- name: 'Az CLI login' | ||
uses: azure/login@v1 | ||
with: | ||
client-id: ${{ secrets.AZURE_CLIENT_ID_DEV }} | ||
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_DEV }} | ||
- name: 'Run Azure Compliance Controls' | ||
uses: ./azure-compliance-action | ||
with: | ||
subscription: ${{ secrets.AZURE_SUBSCRIPTION_ID_DEV }} | ||
- name: 'Run Compliance Controls' | ||
uses: ./compliance-action | ||
with: | ||
cydigConfigPath: ${{ github.workspace }}/compliance-action/src/cydigconfig.json | ||
PAT-token: ${{ secrets.MY_GITHUB_PAT }} | ||
|
||
- name: Set dev func URL | ||
run: | | ||
echo "urlUpdate=${{ secrets.ULR_UPLOAD_DEV }}" >> $GITHUB_ENV | ||
- name: 'Run Upload Action' | ||
uses: ./upload-action | ||
with: | ||
cydigConfigPath: ${{ github.workspace }}/upload-action/src/cydigConfig.json | ||
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID_DEV }} | ||
|
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