Skip to content

About

CI/CD - Build accdb/accde from source (msaccess-vcs exports)

Resources

Stars

4 stars

Watchers

0 watching

Forks

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Latest commit

 

History

150 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

msaccess-vcs-build

CI/CD - Build accdb/accde from source (msaccess-vcs exports)

Thanks to Martin Leduc (DecimalTurn) for VBA-Build, which was a great reference.

Github workflow / Azure devops pipeline

action.yml

inputs:
  source-dir:
    description: 'msaccess-vcs source folder'
    required: false
    default: 'source'
  target-dir:
    description: 'target dir for binary file'
    required: false
    default: ''
  compile:
    description: 'create accde file'
    required: false
    default: false
  vcs-url:
    description: 'msaccess-vcs release url'
    required: false
    default: 'https://api.github.com/repos/joyfullservice/msaccess-vcs-addin/releases/latest'

Example call:

jobs:
  build:
    runs-on: [self-hosted, Windows, Office]

    steps:
    - ...

    - name: "Build Access file (accdb/accde)"
      id: build_access_file
      uses: AccessCodeLib/msaccess-vcs-build@main
      with:
        source-dir: "./Version Control.accda.src"
        target-dir: "bin"
        compile: "false"
        vcs-url: "https://api.github.com/repos/joyfullservice/msaccess-vcs-addin/releases/latest"

Example YAML files

GitHub

Azure DevOps

Self-hosted runner

Requirements

  • Install Office with the appropriate bit version and license
  • msaccess-vcs 5.1 or newer (the default vcs-url downloads the latest release). Older versions do not provide BuildHeadless.

Tips

  • Pre-install msaccess-vcs (version 5.1 or newer) and set the vcs-url parameter to “”.
  • Set the required Trusted Locations
Note

You can also run the Runner on your own developer PC for testing purposes.

Build API and validation

The build uses the headless API of msaccess-vcs (BuildHeadless, Continuous Integration) (available since msaccess-vcs 5.1). The build log is copied to the target folder (also on failure). To fail a build on your own criteria, set ValidateAfterBuild in vcs-options.json to a function in the database that returns True.

PowerShell only - Build.ps1

It is also possible to use only the PowerShell scripts to execute the build process locally.

Parameters

  • [string]$SourceDir = "", # empty use parameter SourceFile, don't use msaccess-vcs
  • [string]$SourceFile = "", # empty = name from vcs options
  • [string]$TargetDir = "", # Folder for output file, default (empty): current folder
  • [string]$Compile = 'false', # Default to "false" if not specified
  • [string]$AppConfigFile = "", # Default "" => don't change database properties etc.
  • [string]$vcsUrl = "https://api.github.com/repos/joyfullservice/msaccess-vcs-addin/releases/latest", # empty = don't install msacess-vcs
  • [string]$SetTrustedLocation = 'true' # set trusted location for current folder

Examples

Build from source

.\Build.ps1 -SourceDir "source" -Compile $true -AppConfigFile ".\Application-Config.json"

Steps:

  1. download msacesss-vcs
  2. build accdb from source via VCS.BuildHeadless (file name from msaccess-vcs property file)
  3. prepare accdb: remove modules and references from Application-Config.json
  4. compile accdb to accde
  5. run procedures and apply database properties from Application-Config.json to the accde

Compile accdb file

.\Build.ps1 -SourceFile "Test.accdb" -Compile $true -AppConfigFile ".\Application-Config.json"

Steps:

  1. prepare Test.accdb: remove modules and references from Application-Config.json
  2. compile Test.accdb to Test.accde
  3. run procedures and apply database properties from Application-Config.json to Test.accde

About

CI/CD - Build accdb/accde from source (msaccess-vcs exports)

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages